Displaying 20 results from an estimated 2000 matches similar to: "Problems with modifying data in a MySQL database"
2010 Nov 07
1
using variable in rmysql query
Dear All,
I am using this query it returns id :
id <- dbGetQuery(con1,"SELECT id FROM tenants WHERE name LIKE '%consim%'")
But In my case the string "consim" is there in another variable(it is
coming from configuration file);
> str <- "consim"
I am trying to replace the string some this like, but it not working:
> id <-
2016 Apr 18
2
lists and rownames
I'm doing some string manipulation on a vector of file names, and noticed
something curious. When I strsplit the vector, I get a list of
character vectors.
The list is numbered, as lists are. When I cast that list as a data
frame with 'as.data.frame()', the resulting columns have names derived
from the original filenames.
Example code is below. My question is, where are these names
2005 Oct 19
1
Socks under R
Hi
when I use
con1 <- socketConnection(...)
in R and want to send text from another application written in Delphi to
R, do I just have to send the text or do I have to implement more
control characters and so on?
Is
con1 <- socketConnection(port=6011, server=TRUE)
writeLines("plot(rnorm(100))", con1)
just sending the text in "plot(rnorm(100))" to the socket or is
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 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
2002 Jan 26
1
Trouble with contrasts
Greetings,
I have a nagging problem with contrasts and I can't seem to resolve it.
A factor exists with four levels (lib1, lib2, con1, con2) and when I
check the contrasts or set the contrasts to any of the prespecified
ones, I do not get the exact contrasts necessary to test the
theoretically relevant ones. I need orthogonal contrasts that look just
like this matrix:
con1 con2
2002 Sep 23
1
socket bug ??? (PR#2056)
Please help me,
I use R-1.4.1 and everything works fine. But with R-1.5.1 ist does'nt work:
I have this put into a file called "socket.R"
while(TRUE){
con1 <- socketConnection(host="localhost",port=6021,server=TRUE);
source(con1);
close(con1);
}
So I can use R with:
source("socket.R")
and R answers me when I send a command to it via socket 6021. But in
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"))
>
2020 Oct 02
3
Lahman Baseball Data Using R DBI Package
I?m trying to pull data from one table (batting) in the Lahman Baseball database. Notice X2B for doubles and X3B for triples ? fourth and fifth from the right.
The dbGetQuery function runs fine when I leave there two out but I get error messages (in red) when I include 2B/3B or X2B/X3B.
Can anyone give me some direction?
Thanks,
Philip Heinrich
2007 May 28
1
command demands double quotes
I have an application called dynaterm which I can run successfully under
wine but to achieve 110% success I need to pass this application a parameter
which must contain double quotes
E.G. C:/Program Files/dynaterm8/dynaterm.exe -connect:"con1"
So I've tried escaping the quotes and setting the launcher command to
wine "C:/Program Files/dynaterm8/dynaterm.exe
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
2009 Jan 28
3
initial value in 'vmmin' is not finite
Dear r helpers
I run the following code for nested logit and got a message that
Error in optim(c(0, 0, 0, 0, 0.1, -2, -0.2), fr, hessian = TRUE, method = "BFGS") : initial value in 'vmmin' is not finite
What does this mean? and how can I correct it?
Thank you
June
> yogurt = read.table("yogurtnp.csv", header=F,sep=",")> attach(yogurt)>
2009 Mar 02
1
initial gradient and vmmin not finite
Dear Rhelpers
I have the problem with initial values, could you please tell me how to solve it?
Thank you
June
> p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2)))
Error in maxRoutine(fn = logLik, grad = grad, hess = hess, start = start, :
NA in the initial gradient
> p = summary(maxLik(fr,start=c(0,0,0,1,0,-25,-0.2),method="BFGS"))
Error in optim(start, func, gr =
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")
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 *
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
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
2010 Dec 10
1
help with RSQLite adding a new column
I'm new to using sql so I'm having difficulties (and worries) in adding a
new column of data to a table I have. Its a very large file (around 5 Gb)
which is why I'm having to use SQL
I have a table with variables ID, IDrec and IDdes and the variables IDrec
and IDdes give a mapping of some other values but the other values are
associated with the ID variable (think of IDrec and IDdes