Displaying 20 results from an estimated 10000 matches similar to: "specifying header in sqldf() and RSQLite"
2011 Sep 29
1
sqldf syntax, selecting rows, and skipping
I am using the example in this post:
https://stat.ethz.ch/pipermail/r-help/2010-October/257204.html
# create a file
write.table(iris,"iris.csv",row.names=FALSE,sep=",",quote=FALSE)
# this does not work
# has the syntax changed or is there a mistake in my usage?
# the line from the post above is:
# read.csv.sql("myfile.csv, sql = "select * from file 2000,
2012 Feb 02
9
sqldf for Very Large Tab Delimited Files
Hi All,
I have a very (very) large tab-delimited text file without headers. There
are only 8 columns and millions of rows. I want to make numerous pieces of
this file by sub-setting it for individual stations. Station is given as in
the first column. I am trying to learn and use sqldf package for this but am
stuck in a couple of places.
To simulate my requirement, I have taken iris dataset as an
2010 Jul 28
1
sqldf 0.3-5 package or tcltk problem
This is my first post. I am running Mac OS X version 10.6.3. I am running R 2.11.0 GUI 1.33 64 bit.
This may or may not be related to sqldf, but I experienced this problem while attempting to use an sqldf query. The same code runs with no problem on my Windows machine. Here is what happens:
> r=sqldf("select ... ")
Loading required package: tcltk
Loading Tcl/Tk interface ...
Then
2010 Nov 01
1
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 <testR.R
2007 Aug 01
1
New R package sqldf
sqldf is an R package for running SQL select
statements on one or more R data frames. It is
optimized for convenience making it useful
for ad hoc queries against R data frames.
Given an SQL select statement whose tables
are the names of R data frames it:
- sets up the database (by default it transparently
sets up an in memory SQLite database using RSQLite;
however, MySQL via RMySQL, can be
2007 Aug 01
1
New R package sqldf
sqldf is an R package for running SQL select
statements on one or more R data frames. It is
optimized for convenience making it useful
for ad hoc queries against R data frames.
Given an SQL select statement whose tables
are the names of R data frames it:
- sets up the database (by default it transparently
sets up an in memory SQLite database using RSQLite;
however, MySQL via RMySQL, can be
2010 Nov 01
1
sqldf hanging on macintosh - works on windows
Have a long script that runs fine on windows (32 bit). When I try to run in
on two different macs (64 bit), however, it hangs with identical behavior.
I start with:
library(sqldf)
This results in messages:
Loading required package: DBI
Loading required package: RSQLite
Loading required package: RSQLite.extfuns
Loading required package: gsubfn
Loading required package: proto
Loading required
2012 Nov 06
1
how Can make function for selecting the products
HI.
I make this code:
getdata<-function('a','b','c' ,'d','e','f'){
drv <- dbDriver("SQLite")
con<-dbConnect(drv, "sqlite.db")
lt<-dbListTables(con)
myf<-data.frame(NULL)
for (i in 1:length(lt))
{
myfile<-dbReadTable(con,lt[i])
myfile1<-myfile[-c(14:44)]
myfile1$MODEL<-gsub(" ",
2012 Jan 23
1
sqldf + Date class. Ordering and summary statistics appear to be incorrect.
I've been using sqldf heavily lately but have encountered problems
with ordering of observations or calculating statistics such as max()
and min() when the variable used is of class Date.
For example, if I run the following code:
=============== begin code =================
library(sqldf)
2008 Dec 14
1
error with sqldf v0-1.4
I'm getting an error message when using the new version of sqldf,
> library(sqldf)
> str(kdv)
'data.frame': 71 obs. of 3 variables:
$ dpss: num 0.117 0.144 0.164 0.166 0.165 ...
$ npdp: num 0.1264 0.0325 0.0109 0.0033 0.0055 ...
$ logk: num 1.12 1.29 1.41 1.41 1.42 ...
> test=sqldf("select * from kdv")
Error in get("fun", env = this, inherits =
2007 Sep 07
3
Delete query in sqldf?
Dear All,
Is sqldf equipped with delete queries? I have tried delete queries but
with no success.
Thanks in advance,
Paul
2008 Jan 29
1
sqldf error
Hi,
sqldf sounds like a very useful package but I don't
even get the example to run:
> a1s <- sqldf("select * from warpbreaks limit
6")
Error in combine(FUN(...)) : argument "value" is
missing, with no default
>
I am using R 2.6.1 on Windows Vista Business and have
updated all packages.
Some help would be very much appreciated.
Many thanks,
Werner
2010 Jan 25
3
question on sqldf syntax
trying to structure sql to merge two datasets. structure follows:
dbs.possible.combos (all possible combinations of dates and places)
Date Place
1/1/10 N-01
1/1/10 S-02
1/2/10 N-01
1/2/10 S-02
etc...
dbs.aggregate (the raw data aggregated by date and location)
Date Place Days
1/1/10 N-01 6
1/1/10 S-02 10
1/2/10 S-02 5
Trying to merge so I look-up the values for each possible combo
dbs.final
2007 Nov 10
7
How to more efficently read in a big matrix
Dear list,
I need to read in a big table with 487 columns and 238,305 rows (row names
and column names are supplied). Is there a code to read in the table in
a fast way? I tried the read.table() but it seems that it takes forever :(
Thanks a lot!
Best,
Allen
2009 Feb 20
2
importing data to SQLite database with sqldf
Hi all,
I am attempting to learn SQL through sqldf...
One task I am particularly interested in is merging separate
(presumably large) files into a single table without loading these
files into R as an intermediate step (by loading them into SQLite and
merging them there).
Taking a step back, I've considered these alternatives:
1) I know if I use straight SQLite commands I might use the
2010 May 20
1
sqldf: issues with natural joins
Hello,
I'm having trouble discovering what's going wrong with my use of natural
joins via sqldf.
Following the instructions under 4i at http://code.google.com/p/sqldf/,
which discusses creating indices to speed joins, I have been only unreliably
able to get natural joins to work.
For example,
> Tid <- c('AES 01-01-02 10:58:00', 'AES 01-01-02 11:53:00', 'AES
2009 Mar 16
1
errors when install RSQLite
Dear all,
I am trying to install RSQLite package since I want to install "sqldf", and
I used
>> install.packages("RSQLite") first, which gave Error message as below:
make: *** [RS-DBI.o] Error 1
chmod: cannot access `/usr/lib/R/library/RSQLite/libs/*': No such file or
directory
ERROR: compilation failed for package 'RSQLite'
** Removing
2011 Mar 09
2
SQLDF - Submitting Queries with R Objects as Columns
Fellow R programmers,
I'd like to submit SQLDF statements with R objects as column names.
For example, I want to assign "X" to "var1" (var1<-"X") and then refer to
"var1" in the SQLDF statement. SQLDF needs to understand that when I
reference "var1", it should look for "X" in the dataframe.
This is necessary because my SQLDF
2008 Aug 28
3
drop unused levels in sqldf
Hi,
sqldf is a fantastic package, but when the SELECT procedure runs unused
levels remain in the output. I tried with the drop function, but without
success. Do you have any suggestions?
Thanx, Gianandrea
data(iris)
require(sqldf)
base<-sqldf("select * from iris where Species <> 'setosa'")
str(base) # Species with 3 levels!
--
View this message in context:
2017 Aug 11
0
Package sqldf in R and dates manipulation
See FAQ #4 on the sqldf github home page.
On Fri, Aug 11, 2017 at 9:21 AM, Mangalani Peter Makananisa
<pmakananisa at sars.gov.za> wrote:
> Dear all,
>
> I recently read the book " R data preperation and manipulation using sqldf package" by Djoni Darmawikarta
> However, I have a problem with manipulation of dates using this package, I do not get the expected results.