[R] sqldf error only on Unix not Windows
Hello Group, I am having trouble with the sqldf package on unix. The same code works fine on windows. Silly Example script: # Load the package library(sqldf) # Use the titanic data set data(women) colnames(women) head(women) sqldf('select height, count(*) from women where height is not null group by weight') Unix Output and error: bash-3.00$ R --vanilla # Load the package > library(sqldf) Loading required package: DBI Loading required package: RSQLite Loading required package: RSQLite.extfuns Loading required package: gsubfn Loading required package: proto Loading required package: tcltk Loading Tcl/Tk interface ... done Loading required package: chron > > > # Use the titanic data set > > data(women) > colnames(women) [1] "height" "weight" > head(women) height weight 1 58115 2 59117 3 60120 4 61123 5 62126 6 63129 > > sqldf('select height, count(*) from women where height is not null group by > weight') Error in sqliteFetch(rs, n = -1, ...) : RSQLite driver: (RS_SQLite_fetch: failed first step: SQL logic error or missing database) Calls: sqldf ... dbGetQuery -> sqliteQuickSQL -> sqliteFetch -> .Call Error in !dbPreExists : invalid argument type Calls: sqldf ... dbGetQuery -> sqliteQuickSQL -> sqliteFetch -> .Call Execution halted Warning message: RS-DBI driver warning: (closing pending result sets before closing this connection) Box: Solaris: SunOS icsun7 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Fire-280R I am unable to find any hits on the generated errors which makes me think either something is really wrong (resource issues or something) or this is not a common use of sqldf?? Is there a better package I should be using? Thank you very much for your help, Alex Bryant Software Development Integrated Clinical Systems, Inc. 908-996-7208 Confidentiality Note: This e-mail, and any attachment to...{{dropped:13}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] multiple variables pointing to single dataframe?
That's great, that will work perfectly.. Thanks All! -Alex -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Monday, April 19, 2010 10:34 AM To: Alex Bryant Cc: r-help@r-project.org Subject: Re: [R] multiple variables pointing to single dataframe? If you only need to retrieve x by referring to x2 and you don`t have to modify x via x2 then this works: > x <- Orange > makeActiveBinding("x2", function() x, .GlobalEnv) > x$age <- 50 > head(x2) Tree age circumference 11 5030 21 5058 31 5087 41 50 115 51 50 120 61 50 142 On Mon, Apr 19, 2010 at 10:15 AM, Alex Bryant wrote: > Hi, for example: > >> x <- Orange >> x2 <- x >> x[1,]$age <- 50 >> x2[1,] > Tree age circumference > 1 1 118 30 > > I would like a way for x2 to also reference the modified x data frame without > having to reassign x2 > Thanks, > Alex > > -Original Message----- > From: Petr PIKAL [mailto:petr.pi...@precheza.cz] > Sent: Monday, April 19, 2010 3:18 AM > To: Alex Bryant > Cc: r-help@r-project.org > Subject: Odp: [R] multiple variables pointing to single dataframe? > > Hi > > r-help-boun...@r-project.org napsal dne 16.04.2010 16:15:40: > >> Hi, I have a need to have 2 variables point to the same dataframe (d1), > I > > What does it mean to point to data frame? Seems to me that it is something > from C+. > > You can reference data frame by $ or by square brackets with as many > variables as you want. > > see > > ?"[" > > regards > Petr > > >> don't want to simply copy the dataframe ( d2<-d1 ) as my understanding > is that >> this will create a second dataframe. Any suggestions on best practice > here? >> >> Thank You, >> >> // >> // Alex Bryant >> // Software Developer >> // Integrated Clinical Systems, Inc. >> // 908-996-7208 >> >> >> >> Confidentiality Note: This e-mail, and any attachment > to...{{dropped:13}} >> >> __ >> R-help@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] multiple variables pointing to single dataframe?
Hi, for example: > x <- Orange > x2 <- x > x[1,]$age <- 50 > x2[1,] Tree age circumference 11 11830 I would like a way for x2 to also reference the modified x data frame without having to reassign x2mailto:petr.pi...@precheza.cz] Sent: Monday, April 19, 2010 3:18 AM To: Alex Bryant Cc: r-help@r-project.org Subject: Odp: [R] multiple variables pointing to single dataframe? Hi r-help-boun...@r-project.org napsal dne 16.04.2010 16:15:40: > Hi, I have a need to have 2 variables point to the same dataframe (d1), I What does it mean to point to data frame? Seems to me that it is something from C+. You can reference data frame by $ or by square brackets with as many variables as you want. see ?"[" regards Petr > don't want to simply copy the dataframe ( d2<-d1 ) as my understanding is that > this will create a second dataframe. Any suggestions on best practice here? > > Thank You, > > // > // Alex Bryant > // Software Developer > // Integrated Clinical Systems, Inc. > // 908-996-7208 > > > > Confidentiality Note: This e-mail, and any attachment to...{{dropped:13}} > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] multiple variables pointing to single dataframe?
Hi, I have a need to have 2 variables point to the same dataframe (d1), I don't want to simply copy the dataframe ( d2<-d1 ) as my understanding is that this will create a second dataframe. Any suggestions on best practice here? Thank You, // // Alex Bryant // Software Developer // Integrated Clinical Systems, Inc. // 908-996-7208 Confidentiality Note: This e-mail, and any attachment to...{{dropped:13}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] R output to Rich Text Format
Hi, Does anyone know of an existing package that will output to rtf? Something along the lines of pdf(ds,'file.pdf') or write.csv(ds,'file.csv'). Thanks, //**** // Alex Bryant // Software Developer // Integrated Clinical Systems, Inc. // 908-996-7208 Confidentiality Note: This e-mail, and any attachment to...{{dropped:13}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] R Graphic output files on Solaris 5.10
Hello Folks, I have a need to generate Graphic output files (gif, jpeg, pdf, etc..) on a Solaris Environment, however this environment does not have X11 setup and setting up X11 would be a last resort if required. I have attempted to install GDD and Cairo without success up to this point. Is there a simple way to do this that does not require X11, GDD or Cairo? $ uname -a SunOS icsun7 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Fire-280R > version _ platform sparc-sun-solaris2.10 arch sparc os solaris2.10 system sparc, solaris2.10 status major 2 minor 10.1 year 2009 month 12 day14 svn rev50720 language R version.string R version 2.10.1 (2009-12-14) Thank you for any thoughts. // // Alex Bryant // Software Developer // Integrated Clinical Systems, Inc. // 908-996-7208 Confidentiality Note: This e-mail, and any attachment to...{{dropped:13}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Reading sas7bdat files directly
Hi, I have a need to process (in real-time) a large number of .sas7bdat files from within R. The problem is I don't want to convert these files to .xpt (transport) every time. So just checking if anyone has a (viable) way to read .sas7bdat files directly into R? Thank You. //-- // Alex Bryant // Software Developer // Integrated Clinical systems // 908-996-7208 Confidentiality Note: This e-mail, and any attachment to...{{dropped:13}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.