Displaying 20 results from an estimated 2000 matches similar to: "sqldf syntax"
2013 Jan 15
1
SQLDF column errors
I am trying to exclude integer values from a small data frame 1, d1 that
have matching hits in data frame 2, d2 (Very big) which involves matching
those hits first. I am trying to use sqldf on the df's in the following
fashion:
df1:
V1
12675
14753
16222
18765
df2: head(df2)
V1 V2
13647 rd1500
14753 rd1580
15987 rd1590
16222 rd2020.....
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
2010 Jul 20
1
Error using sqldf
Hi,
I am running a query using sqldf() [package : sqldf]. The query is:-
userid <- 5
taskid <- 5
tab1 <- fn$sqldf("SELECT tobiiEvents.data1, tobiiEvents.data2,
events.`timestamp` as tobiiTime
FROM tobiiEvents
INNER JOIN events ON events.eventid = tobiiEvents.eventid
WHERE tobiiEvents.subtype = 'MOUSE' AND tobiiEvents.userid = 5 AND
tobiiEvents.taskid = 5
ORDER BY
2011 Apr 18
2
SQLDF syntax
Hi,
I am new to R and trying to migrate from SAS. I am trying to use sqldf to
create a new table from existed table and change some of the columns. I have
table called DataOld with columns commodity, rate and total and I am trying
to create new table called DataNew with columns commodity, ratenew and
totalNew.
> sqldf("create table datanew as select commodity, ratenew as rate * 10,
>
2012 Mar 21
1
Using extract function for dates in sqldf
I'm trying to use sqldf to query for the earliest date of a blood test when
patients have had multiple tests in a given year. My query looks like this:
test11 <- sqldf("select CHILD_ID, min(SAMP_DATE)
from lab
group by CHILD_ID
having extract (year from SAMP_DATE) = 2011")
SAMP_DATE has class "date." I get the error
2008 Apr 03
2
sqldf file specification, non-ASCII
Dear R-Listers,
I am a Windows user (R 2.6.2) using the development version of sqldf to
try to read a 3GB file originally stored in .sas7bdat-format. I convert
it to comma-delimited ASCII format with StatTransfer before trying to
import just the rows I need into R. The problem is that I get this
error:
> f <- file("hugedata.csv")
> DF <- sqldf("select * from f where
2012 May 09
2
Problem with SQLDF - Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table:
Hi All,
I am having trouble executing SQL statements on a few dataframes, but the
funny thing is that I am able to execute the statement on some other
dataframes.
To test, I have 2 very small dataframes (6 rows and some columns). One is
'lessliq', the dput is given below.
> dput(head(lessliq))
structure(list(V1 = c(50464677L, 50464846L, 50432581L, 50426614L,
50504329L, 50504735L), V2
2010 Sep 06
3
Failure to aggregate
I have a (very big - 1.5 rows) dataframe with a (POSIXt" "POSIXlt") column h
(hour). Surprisingly, I cannot calculate a simple aggregate over the
dataframe.
> n.h1 = sqldf("select distinct h, count(*) from x group by h")
Error in sqliteExecStatement(con, statement, bind.data) :
RS-DBI driver: (error in statement: no such table: x)
In addition: Warning message:
In
2012 Nov 23
3
read.csv.sql() to select from a large csv file
Dear list,
Dear list,
I am using read.csv.sql() from the sqldf package to read
individual-based data from a csv file that is too large for R.
My original file contains a column called “ID” that
identifies the individual. I would like to read in data for only
one individual at a
time, for example "Bobby".
read.csv.sql("filename",sql = 'select * from file where ID =
2011 Aug 20
4
I have a problem with R!!
Dear all
i?m working with a program i?ve made in R (using functions that others
created)
to run my program i need a sample. if i generate the sample using for
example, rnorm(n, mu, sigma) i have no problem
but if i obtain a sample from a column in excel and i copy it, the program
says that there is a mistake: it says "Error en `[.data.frame`(data,
indices) : undefined columns
2008 Sep 15
2
S4 coercion responsibility
Should functions or the user be responsible for coercing an S4 object
argument containing the proper object (and thus should below be
considered a bug in the packages or not)?
The example is with RSQLite but the same thing happens with RMySQL, and
other DBI packages.
> library("RSQLite") Loading required package: DBI
> m <- dbDriver("SQLite")
> con <-
2004 Nov 25
3
Searching for a string in RSQLite
I'd like to search for a particular string in an SQLite database using
RSQLite, but I'm running into problems constructing the query
properly, because of embedded quotes and parens in the string.
Is there a function that escapes these for me, or some other fixup
that would let me do the queries below? In the real situation I don't
have control over what strings get searched for.
2008 May 12
1
Insert a recorde into a table using SQL
Dear list,
I want to insert a recorde into a SQLite table by dbGetQuery(), but
there is a problem when the value contains quotation mark.
> dd<-data.frame(txt=c("having both ' and \" in character.","OK"))
> library(RSQLite)
Loading required package: DBI
> con<-dbConnect(dbDriver("SQLite"),":memory:")
>
2010 Aug 27
1
Error: package/namespace load failed for 'IlluminaHumanMethylation27k.db'
Hello everyone,
I have a problem when loading the library: IlluminaHumanMethylation27k.db
I installed the package from zip (from the Bioconductor website), and also
installed all the packages it asked for. It went all succesfull:
"package 'IlluminaHumanMethylation27k.db' successfully unpacked and MD5 sums
checked"
But when I am trying to load this library I get an error:
2008 Jul 14
3
Data Manipulations and SQL
Greetings,
I am new to R and have some background knowledge about SQL. I'd like to
know whether there is a way to manipulate the R datasets (or data
frames) using SQL statements. For example, I have two data frames and
both of them have a column called "id", then I want to join this two
data frames into one. In SQL, we can just simply use the join comment.
What should we do in R?
2013 Jul 15
2
Serialize data.frame to database
Dear R-Users,
I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to store this data to an SQLite database.
This is what I tried to do:
library(RSQLite)
con <- dbDriver("SQLite")
db <- dbConnect(con, "test")
dbSendQuery(db, 'CREATE TABLE frames("simID" INT, "data" BLOB)')
data.bin <-
2018 Mar 22
2
how to add a child to a child in XML
Big thanks. newXMLNode works great. Wonder why it is not included in the documentation.
There is newXMLDoc and newXMLNamespace, but no mention of newXMLNode.
Stephen
From: Ben Tupper [mailto:btupper at bigelow.org]
Sent: Wednesday, March 21, 2018 6:18 PM
To: Bond, Stephen
Cc: r-help
Subject: Re: [R] how to add a child to a child in XML
Hi,
XML doesn't use the `$` to access child nodes.
2017 Nov 10
3
update R version in windows
However, trying this on Linux Mint gave
package ?installr? is not available (for R version 3.4.2)
Has the package not been updated yet?
JN
Try the installr package. It was designed for this purpose.
On Fri, Nov 10, 2017 at 11:49 AM, Bond, Stephen <Stephen.Bond at cibc.com> wrote:
> Is there a utility which will allow me to upgrade my R version and update all packages from the old
2018 Mar 22
0
how to add a child to a child in XML
Hi,
It's a reasonable question. The answer is that it actually is included, but there are many instances across packages where multiple functions are documented on a single help page. The following brings up such a page... (for XML_3.98-1.9)
> library(XML)
> ?newXMLNode
You can see the same on line...
https://www.rdocumentation.org/packages/XML/versions/3.98-1.9/topics/newXMLDoc
2018 Mar 22
1
how to add a child to a child in XML
Just to clarify and hopefully catch the attention of the maintainer:
The newXMLNode function is not mentioned in:
https://cran.r-project.org/web/packages/XML/XML.pdf
which supposedly describes all functions in the package.
Stephen
From: Ben Tupper [mailto:btupper at bigelow.org]
Sent: Thursday, March 22, 2018 10:40 AM
To: Bond, Stephen
Cc: r-help
Subject: Re: [R] how to add a child to a