Search code examples
rmigrating

R slight difference since ‘sqldf’ version 0.4-10, treating of period separated variable names


There is a slight difference in the way sqldf treats variable names between R 3.1.1+ (‘sqldf’ version 0.4-10+) and 3.0.2 (‘sqldf’ version 0.4-6.4). If you run the code below, the variable separated by a period will be altered to be separated by an underscore in the older version and will remain period separated in the newer version. Posting here in case someone else is having difficulty with migrating code from older versions.

    set.seed(123)
    Data1 <- data.frame(
    X = sample(1:10),
    Y.n = (sample(c("E6      ", " B5"), 10, replace=T))
   )
  Data2 <- data.frame(
    X = sample(1:10),
    A = sample(c("Joined", "Yep joined"), 10, replace = TRUE)
   )
require(sqldf)
DataSqldf <- sqldf('SELECT * FROM Data1 JOIN Data2 ON Data1.X = Data2.X')
require(stringr)
DataSqldf$Y_n <- str_trim(DataSqldf$Y_n, side = "both")

Question: Is there a good collation of change logs for packages?


Solution

  • This change in RSQLite (not sqldf) was mentioned on the sqldf googlecode home page (http://sqldf.googlecode.com) which has since been moved to the github README.md file: https://github.com/ggrothendieck/sqldf (and the googlecode page now forwards to the github page with the README.md rendered at the bottom).

    For sqldf, the commit log is online: https://github.com/ggrothendieck/sqldf/commits/master

    Also, there is a NEWS file: https://github.com/ggrothendieck/sqldf/blob/master/inst/NEWS The NEWS file is also accessible from within R:

    news(package = "sqldf")
    

    There is also a discussion group: https://groups.google.com/forum/#!forum/sqldf

    All these resources are accessible via one click from the sqldf CRAN page: http://cran.r-project.org/package=sqldf (except for the commit log which is two clicks).