Displaying 20 results from an estimated 11000 matches similar to: "How to remove white spaces"
2007 Nov 13
1
R: Query an Access database based on a date attribute
It seems that Access needs that you surround the dates with a # symbol.
You probably need something like.
res <- sqlQuery(channel, "select * from test_table where market = 'atl-bos'
and competitor = 'delta' and dd = #2007-11-20#")
Hope this helps,
Stefano
-----Messaggio originale-----
Da: r-help-bounces at r-project.org
[mailto:r-help-bounces at r-project.org]Per
2006 Oct 17
2
RODBC and NULL values
Dear All,
Writing sooner than I thought I'd need to.
I'm using R 2.4 on Mac OS X, with RODBC, PostgreSQL 8.1 and Actual's
ODBC driver. I have all my data in Filemaker 8.5, but it is
automatically exported into PostgreSQL for analysis as Filemaker's ODBC
and JDBC access is awful, slow and has a tendency to crash.
I have disability data where for each patient there is a survival
2004 Sep 02
8
newsgroup on R
HI, I wonder if there is a newsgroup on R available, instead of
emaillist which I have to receive mails daily.
Cheers.
Bin
2009 Nov 20
3
Remove leading and trailing white spaces
I have a character string and I would like to remove the leading and
tailing white spaces. The example for 'sub' shows how to remove the
trailing white spaces, but I still can't figure out how to remove both
trailing and leading white spaces because I can't find any documentation
for what "+$" means or what "\\s+$" means. Maybe its because I don't
have a
2009 May 19
2
create string of comma-separated content of vector
Hi,
how do I create a string of the comma-separated content of a vector?
I've got the vector i with several numeric values as content:
>str(i)
num 99
and want to create a SQL statement to look like the following where
the part '(2, 4, 6, 7)' should be
the content of the vector i:
select * from [biomass_data$] where site_no in (2, 4, 6, 7)
Here my approach (which doesn't
2003 Feb 10
3
non-SQL sqlQuery error
Dear all,
I've encountered a curious problem. I am trying to run an SQL query
using sqlQuery() function in RODBC.
The query works fine when run in a stand-alone SQL browser (Microsoft
Query Analyzer, in particular).
However, when I use the exact same thing from sqlQuery() function, I get
the following error:
Error in "[.data.frame"(data, , ) : not all specified columns exist
2010 Oct 11
1
importing numeric types via sqlQuery
Hi everyone,
I am using the sqlQuery function (in RODBC library) to import data from a database into R. My table (called temp) in the database looks like this:
category numabc 54469517.307692307692def 36428860.230769230769
I used the following R code to pull data into R:data <-sqlQuery(channel, "select category, num from temp;")
However, the result is that "num" gets all its
2006 Oct 13
1
RODBC sqlQuery insert slow
Large for loops are slow. Try to avoid them using apply, sapply, etc.
I've made the paste statements a lot shorter by using collapse. See
?paste for more info.
Append.SQL <- function(x, channel){
sql="INSERT INTO logger (time, v1, v2, v3, v4, v5, v6, v7, v8, v9,
v10) VALUES("d1=strptime(x[2],"%d/%m/%y %H:%M:%S %p '", d1, "' ,",
paste(x[3:12],
2011 Jul 13
2
Executing a function correctly
Hello All,
I've created a function as follows so as to use it in a loop.
freq<-function(i)
{
library(RODBC)
paste(i,"<-sqlQuery(conn,","'","select click_flg, open_flg,", i ," from
modeling_5')",sep="")
}
freq(i="AQI")
[1] "AQI<-sqlQuery(conn,'select click_flg, open_flg,AQI from modeling_5')"
2018 Feb 15
3
help (Crear bucle para generar un dataframe a partir de datos .mdb)
Hola,
Tengo un conjunto de bases de datos de una encuesta industrial para
diferentes años (1995-2014). Las bases de datos están en formato .mdb. A su
vez, cada base de datos tiene 3 tablas con una variable "ID" común (la
"llave") para vincular las tablas.
Quiero realizar análisis estadísticos para analizar la evolución de ciertas
variables.
Quiero armar un dataframe que
2009 Jan 26
2
R crashes when using the RODBC Package
Hi,
I've written some code that fetches data from an Access Database (2003),
processes the data, then saves the modified data back into a table in the
Access database.
It works if I only pass through the code once, but if I put a loop around
the code so that I fetch data from a different source table, and then save
it again to a different destination table, the code crashes. It is
2011 Dec 20
1
RODBC Error: 'getCharCE' must be called on a CHARSXP
I am trying to connect to an internal database and use the sqlQuery command to reduce and retrieve data using the following code:
channel <-odbcConnect("some_dsn", uid="", pwd="")
txt<-'SELECT Date, Region, Price FROM TableXYZ WHERE Type="Domestic"'
sqlQuery(channel, cat(txt,"\n"),errors=TRUE,)
close(channel)
However, I get the
2010 Feb 12
1
Assign Name of Data Frame
Hello R Experts,
How can I assign the name of a data frame with the argument of a
function? Specifically I am using RODBC to build local dataframes
from SAS datasets on a
remote server. I would like the local dataframe have the same name as
the source SAS dataset, and the function below is what I am
developing. However, the "substitute(table)" on the left side of the
assignment
2010 Mar 24
3
string problems in R
Hello all
I have been working on my thesis using R. I am a newbie to R and met a problem
that bothered me for a while due to my lack of acquaintance of R.
I am using R to query from SQL. I got a list of crsp_fundno of G-style mutual
funds which is still alive. I use the following codes and got what I want:
library(RODBC)
channel<-odbcConnect("CRSPFUND")
2008 Jul 28
4
RODBC to query an Oracle table
Hello all,
I am having trouble running a count function in R using RODBC to query a table I created in Oracle. It may very well be that my SQL coding is incorrect; I just started learning it. But if someone could point me in the right direction or tell me if I am going about this the correct way that would be greatly appreciated! The script I have right now is:
>require(RODBC)
2009 Sep 15
1
quoting a table name due to a special character in sqlQuery (RODBC)
Dear List,
I have a problem with RODBC on a Paradox-DB, sqlQuery, and special
characters in table names. Unfortunately, some of the latter include the
underscore <_>. And I am not able to change them.
That's not a problem, when I quote the table name:
> sqlQuery(channel2, 'SELECT * FROM "anmeldung-alt"')
Btw, if I swap ' and " it does not work:
>
2005 Oct 19
3
sqlQuery and string selection
Dear alls,
Could someone tell me how to select a subset of string observations (e.g.
"females" in a sex column) with sqlQuery in the RODBC library?
Indeed, I'm trying to select a subset of observations on my access database
with:
female<-sqlQuery(mychannel,"SELECT Micromammiferes.sex
FROM Micromammiferes
WHERE (((Micromammiferes.sex)="females"));")
The sql
2010 Mar 30
1
dataframe in loop
hello all:
I would like to thank those who helped me out of the string
problem..but now I got another problem.
I used R to query from SQL and got a list of crsp_fundno of G-style mutual
funds which is still alive. I use the following codes and got what I want:
library(RODBC)
channel<-odbcConnect("CRSPFUND")
g.crspfundno<-sqlQuery(channel,"select crsp_fundno from Fund_style
2010 Feb 26
1
RODBC looping sql script
Dear R users,
I am querying an Oracle database using sqlQuery() from the RODBC
package. What I would like to do is embed my R Sql query in a for loop.
For example
suppose the data.frame "vessel" contains two columns: vessel[,1]= vessel
id and vessel[,2]=permit year
I am using "vessel" as an input in a SQL based function that require
inputs of permit year and vessel id
2009 Apr 21
3
create objects in a loop and adding sqlQuery content to them
Hi there,
I've got a database or rather spreadsheet with several columns and rows.
For one column named sites I want to loop through all possible values
and retrieve
all data out of the database where site = x and write it into an
object named 'sitex_data'.
Somehow I'm really missing something as I'm not able to create these
sitex_data objects with
the database values,