[R] "\r" with RSQLite

Mikkel Grum mi2kelgrum at yahoo.com
Wed Mar 15 19:45:34 CET 2006


What am I doing wrong, or is the \r that I'm getting
in the example below a bug?

> a <- (1:10)
> b <- (LETTERS[1:10])
> df <- as.data.frame(cbind(a, b))
> 
> df
    a b
1   1 A
2   2 B
3   3 C
4   4 D
5   5 E
6   6 F
7   7 G
8   8 H
9   9 I
10 10 J
> library(RSQLite)
> drv <- dbDriver("SQLite")
> con <- dbConnect(drv, dbname = "Test")
>     dbWriteTable(con, "DF", df, row.names = FALSE,
overwrite = TRUE)
[1] TRUE
>     df2 <- dbGetQuery(con, "SELECT DISTINCT * FROM
DF")
> dbDisconnect(con)
[1] TRUE
> df2
    a   b
1   1 A\r
2   2 B\r
3   3 C\r
4   4 D\r
5   5 E\r
6   6 F\r
7   7 G\r
8   8 H\r
9   9 I\r
10 10 J\r

> sessionInfo()
R version 2.2.1, 2005-12-20, i386-pc-mingw32 

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices"
"utils"     "datasets" 
[7] "base"     

other attached packages:
 RSQLite      DBI 
 "0.4-1" "0.1-10" 


Mikkel Grum
Genetic Diversity
International Plant Genetic Resources Institute




More information about the R-help mailing list