Displaying 20 results from an estimated 2000 matches similar to: "importing data to SQLite database with sqldf"
2011 Mar 10
1
getting percentiles by factor
Hello,
I'm trying to get percentiles (PERCENTRANK for excel users) by factor in the
following data.frame:
myExample <- data.frame(Ret=seq(-2, 2.5,
by=0.5),PE=seq(10,19),Sectors=rep(c("Financial","Industrial"),5))
myExample <- na.omit(myExample)
Thanks to Patrick I I managed to put together the following lines which does
it for the "Ret" column:
myecdf
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
2010 May 18
1
difficulties with setMethod("[" and ...
Apologies if I am not understanding something about how things are being
handled when using S4 methods, but I have been unable to find an answer to
my problem for some time now.
Briefly, I am associating the generic '[' with a class which I wrote
(here: myExample). The underlying back-end allows me to read contiguous
slabs, e.g., 1:10, but not c(1, 10). I want to shield the user from this
2010 Jul 16
1
sqldf modify table
Hi - I am something of a newbie and am a little perplexed. When (trying to)
modify a table I issue the following commands with subsequent errors
sqldf("alter table Korea drop column code", dbname = "mydb")
error in statement: near "drop": syntax error
or
sqldf("alter table Korea rename column hyr to hyrI", dbname = "mydb")
error in statement:
2006 May 26
1
R.oo question
This is a simple R.oo question but I, thankfully, hope that someone
would explain it to me so I would better understand this work frame.
I create this class:
setConstructorS3("MyExample", function(param=0) {
print(paste("called with param=", param))
extend(Object(), "MyExample",
.param = param
);
})
>From what is printed out, who made the second call to
2012 Jun 26
5
Next Problem: Puppet 2.7 + Passenger won't connect
OK. What did I booger up this time ?
agent.myexample.org and puppetmaster.myexample.org are the same server.
----------------------------------------------------------------------------
# puppetd --no-daemonize --onetime --debug --noop
debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
debug: Puppet::Type::User::ProviderDirectoryservice: file /usr/bin/dscl does not
2012 Aug 20
1
function case in sqldf (datas from oracle) with a null value
I use sqldf to join 2 dataframes from 2 distinct databases : a and b come
from old sqldf's.
sqldf("select a.*, b.*, case a.QTY when null then b.QTY else a.QTY end as
NEW_QTY"
from a inner join b on a.OBJECT=b.OBJECT")
R doesn't understand "when null". I tried with "when NA", "when '' ", "when
' ' " but it doesn't
2011 Mar 02
1
a question on sqldf's handling of missing value and factor
Dear subscribers:
I am using the following code to read a large number of big text files:
library(sqldf)
tempd <- file(XXXX)
tempdx <- sqldf("select * from tempd", dbname = tempfile(), file.format =
list(header = T, sep="\t", row.names = F))
The problem is: all my numberical variable become factor (maybe because
these columns all contain missing value). It would be
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
2004 May 10
1
RODBC in RAqua
I've been trying to get RODBC working in RAqua. For my database,
let's call it "mydb", when I enter
odbcConnect("mydb")
or
odbcConnect("mydb", uid="postgres", pwd="secret"),
RAqua thinks for about 10 seconds, then crashes.
mydb is a PostgreSQL 7.4.2 database running on my machine (Mac OS X
10.3.3). I am using the pgsqlodbc 7.2.5 driver
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
2015 Jul 27
2
Error sql en función
Hola Carlos:
Gracias por responder!
Ayer caí en esta página al buscar el problema con google, pero no conseguir entender y implementar lo que sugiere. Sin entender nada, lo que hice fue:
========================
> library(MASS)
> library (sqldf) # Per SQL
> data(Aids2, package="MASS")
> SQL_PROVA = function (XDADES, XWHE)
+ {
+ XDADES_SQL = sqldf ("select * from
2006 Mar 26
4
select information from sqlite_master error
Hi,
I''m having fun playing around with Camping...I am slowly working on extending tepee to a personal e-notebook sort of tool (never lose my papers/revisions....hehe).
I''ve given tepee an oswd css design, and am currently adding a admin page that I want to show the ruby version, sqlite version and db size and db stats information.
I tried running:
@db_stats =
2017 Aug 11
2
Package sqldf in R and dates manipulation
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. Do I need to install some packages to be able to subset the data by dates in sqldf?
I am not getting Djoni Darmawikarta email address.
Please see the practice
2009 Jan 20
1
Problem with FAME
Dear All,
I wonder whether anyone has an experience with FAME package written by Jeff Hallman. All my attempts to send him the following problem report did not succeed (the mail system says that my e-mail could not be delivered), so I turn for help to this list.
I tried to use your FAME package written for R, but somehow I cannot get it working. I am using Windows XP and the newest R
2015 Jul 27
2
Error sql en función
Hola:
No consigo que la función sqldf () funcione dentro de una función. Alguien puede echarme una mano. En resumen, el problema es que cuando lo ejecuto fuera de una función no tengo ningún problema:
==========================
> # install.packages("sqldf")
> library(MASS)
> library (sqldf)
> data(Aids2, package="MASS")
> options(digits=3)
> table
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 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:
2014 Mar 12
2
Frecuencia absoluta acumulada por individuo y por
Por si tienes especial interés en utilizar sqldf:
todos <- sqldf(
"select distinct a.ID,b.YEAR
from dt a , dt b;")
suma <- sqldf(
"select ID,YEAR,sum(CANTIDAD) as CANTIDAD
from dt
group by ID,YEAR;")
todos <- sqldf(
"select a.ID,a.YEAR, CANTIDAD
from todos a left join suma b
on a.ID = b.ID and a.YEAR = b.YEAR
group by a.ID,a.YEAR;")
todos$CANTIDAD =