Displaying 20 results from an estimated 1000 matches similar to: "help with RSQLite adding a new column"
2010 Dec 11
0
is there a packge or code to generate markov chains in R
Hi,
if i have data in the following time series format:
time, amount, state
1 2222 A
1 333 B
2 45 A
2 77 B
where states could be n and time periods t is there a package in R that would calculate the transition probabilities in a markov chain.
for each t except t=0 to generate
A B
A
B
perhaps the best structure might
2011 Feb 28
1
Data type problem when extract data from SQLite to R by using RSQLite
Hi there,
When I extract data from SQLite to R, the data types (or modes) of the
extracted data seems to be determined by the value of the first row.
Please see the following example.
When I put the missing values first, the column extracted is of the
mode character.
> str(dbGetQuery(sql.industry,
+ "select pya_var from annual_data3
+ order by
2009 Dec 18
1
The RSQLite version of dbGetQuery drops colums
Hi all,
I just noticed (the hard way of course) that when a query returns 0
rows, the columns in the resulting data.frame get dropped as well. See
the following example code (where conn is an active connection to an
SQLite db):
> dbGetQuery(conn, "select 1 as hey, 2 as ho where 1")
hey ho
1 1 2
> dbGetQuery(conn, "select 1 as hey, 2 as ho where 0")
data frame
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.
2009 Nov 30
1
RSQLite does not read very large values correctly
Hello,
I am trying to import data from an SQLite database to R.
Unfortunately, I seem to get wrong data when I try to import very large
numbers.
For example:
I look at the database via SQLiteStudio(v.1.1.3) and I see the following
values:
OrderID Day TimeToclose
1 2009-11-25 29467907000
2 2009-11-25 29467907000
3 2009-11-25 29467907000
Now I run this R Code:
>
2009 Mar 30
1
Importing csv file with character values into sqlite3 and subsequent problem in R / RSQLite
Dear all,
I'm trying to import a csv file into sqlite3 and from there into
R. Everything looks fine exepct that R outputs the character values in
an odd fashion: they are shown as "\"CHARACTER\"" instead of
"CHARACTER", but only if I show the character variable as a
vector. Does someone know why this happens? Below is a sample
code. The first part is written in
2006 Mar 15
3
"\r" with RSQLite
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")
2006 Mar 15
3
"\r" with RSQLite
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")
2012 Mar 24
2
RC / methods package
(I think this is being caused by the new methods package in RC.)
In the RC (March 24) some of my packages are generating a Note
Note: Method with signature "MySQLConnection#integer" chosen for
function "coerce",
target signature "TSMySQLConnection#integer".
"dbObjectId#integer" would also be valid
This is coming from a call to dbGetQuery() in package
2008 Jan 26
0
RSQLite 0.6-7 -- changes to dbGetQuery semantics
RSQLite 0.6-7 has been uploaded to CRAN and should hit a mirror near
you in the next few days.
This version changes the behavior of the dbGetQuery method to make it
more consistent with dbSendQuery. Specifically:
1. dbGetQuery now closes a complete result set as dbSendQuery does.
2. If there is an incomplete result set open, dbGetQuery still opens a
new temporary connection, but now issues
2008 Jan 26
0
RSQLite 0.6-7 -- changes to dbGetQuery semantics
RSQLite 0.6-7 has been uploaded to CRAN and should hit a mirror near
you in the next few days.
This version changes the behavior of the dbGetQuery method to make it
more consistent with dbSendQuery. Specifically:
1. dbGetQuery now closes a complete result set as dbSendQuery does.
2. If there is an incomplete result set open, dbGetQuery still opens a
new temporary connection, but now issues
2006 May 06
1
Weird blank spacing in plot title when using \n and plotmath
Dear R-helpers,
I have been using \n in my plot titles to split long titles into two lines. I recently tried combining \n and plotmath which still gives me two lines for the title but also a weird blank spacing. A simple example is as follows:
plot(1:10, main=expression(paste("Exposure\nTemp (", degree*F, ")")))
Is there something I'm missing to close the spacing.
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:")
>
2006 Dec 20
1
DBI + ROracle problem with parser ?? (PR#9424)
Full_Name: Christian Hoffmann
Version: 2.4.0
OS: Win 2000
Submission from: (NULL) (193.134.202.252)
Database queries using the combination DBI + ROracle are handicapped by
quirks in the pipeline between the textual representation of the query
and the database engine Oracle. Comments and linefeed at start are
interfering:
dbGetQuery(conn, query):
works:
dbGetQuery(conn, "select *
2013 Feb 12
0
How do I solve a disk I/O error with RSQLite?
Hi there,
I had an error when using RSQLite. My code and the error message are
the following:
> dbGetQuery(sql.dispersion,
+ "create table monthly_data_temp as
+ select a.*, b.industry
+ from monthly_data as a left join
+ siccd_industry_ff49 as b
+ on a.siccd = b.siccd
+ order by permno, date")
Error
2020 Oct 08
0
Lahman Baseball Data Using R DBI Package
Hi Philip,
You've probably realized by now that R doesn't like column names that
start with a number. If you try to access an R-dataframe column named
2B or 3B with the familiar "$" notation, you'll get an error:
> library(DBI)
> library(RSQLite)
> con2 <- dbConnect(SQLite(), "~/R_Dir/lahmansbaseballdb.sqlite")
> Hack12Batting <-
2020 Oct 08
1
Lahman Baseball Data Using R DBI Package
This is really a feature of SQL, not R. SQL requires that you double quote
column names that start with numbers, include spaces, etc., or that are SQL
key words. E.g.,
> d <- data.frame(Order=c("sit","stay","heel"),
Where=c("here","there","there"), From=c("me","me","you"))
>
2017 Oct 24
2
Creating a data table (frame?) from a SQL Statement?
Hello,
I'm new to R so this is probably a simple question for somebody.
I have an RScript that reads a CSV on the disk using read.table(...). It then does a boxM test using that data.
However, I'm now trying to load the same data via an SQL command, but I can't seem to get the data structure defined so R will like it -- using the included "iris" dataset.
I've tried
2009 Jan 10
0
RMySQL CREATE TABLE error
Hi all-
I am stumped. The code in A. returns errors at lines 14 and 15 and fails
to load series1 and series2. However, in B., if temp1 and temp2 are
called again (which returns a "Table exists" error; see lines 14-17 in
B.) series1 and series2 load correctly. Any ideas? Also-I am open to any
suggestions to improve the code as I am a horrific programmer. Thanks
A.
1 >
2020 Oct 03
1
Lahman Baseball Data Using R DBI Package
The double quotes are required by SQL if a name is not of the form
letter-followed-by-any-number-of-letters-or-numbers or if the name is a SQL
keyword like 'where' or 'select'. If you are doing this from a function,
you may as well quote all the names.
-Bill
On Fri, Oct 2, 2020 at 6:18 PM Philip <herd_dog at cox.net> wrote:
> The \?2B\? worked. Have no idea why. Can