Displaying 20 results from an estimated 400 matches similar to: "Variables in RODBC environment"
2010 Jun 03
2
lapply or data.table to find a unit's previous transaction
I have a dataset of property transactions that includes the
transaction ID (TranID), property ID (UnitID), and transaction date
(TranDt). I need to create a data frame (or data table) that includes
the previous transaction date, if one exists.
This is an easy problem in SQL, where I just run a sub-query, but I'm
trying to make R my one-stop-shopping program. ?The following code
works on a
2006 Sep 13
9
R-question
Hello Colleagues,
I programmed in SAS for 3 years and would like to switch to a not so costly
software product.
Hence I started to evaluate R, and my first test look promising.
However I have some question:
1. Is it possible to query R files by SQL internally on data frames (not on
a database) and how is the syntax (I have the RODBC package installed).
I would like to extract year, Quarter,
2008 Jun 04
1
possible bug in flexclust
Hi - Writing to see if someone can suggest whether a problem warrants a bug
report. It concerns the use of stepFlexclust in the flexclust package. The
problem concerns the size of clusters returned.
Versions: R-2.7.0 on Windows XP; RODBC_1.2-3
code snippet:
r8 <- stepFlexclust(df,8,nrep=100,FUN=kcca, family=kccaFamily("kmedians"))
summary(r8) ## returns cluster sizes of 51, 115,
2006 Nov 07
3
Reformat a data frame
Hello Experts,
how do I reformat a data frame in the way described below:
df1:
ID desc resist thick temp
1 4711 100 5 20
2 4712 101 4 21
3 4711 99 3 19
4 4712 98 7 22
TO
df2:
id desc Param Value
1 4711 resist 100
1 4711 Thick 5
1 4711 temp 20
2 4712 resist 101
2 4712 Thick 4
2 4712 temp 21
3
2006 Sep 27
1
Impossible to merge with a zero rows data frame?
I'm trying to merge two data frames. One of them is a zero rows data
frame.
I'm using the merge parameter 'all.x = TRUE' so I'd expect to obtain all
the rows of x. In fact the merge help says:
all.x: logical; if 'TRUE', then extra rows will be added to the
output, one for each row in 'x' that has no matching row in
'y'. These rows
2008 May 28
4
Help on Calculating day differences
Hello R Freaks,
I calculate the difference in days between two events with the following
litte R expresseion:
T1a <- strptime(T1,"%m/%d/%y %H:%M:%S");
T2a <- strptime(T2,"%m/%d/%y %H:%M:%S");
T1b <- as.Date(T1a);
T2b <- as.Date(T2a);
days <- T2b-T1b;
time <- T2a - T1a;
In the project I would like to calculate only working day.
I the a possibility to count
2006 Aug 22
1
Selection on dataframe based on order of rows
I have a dataframe with the following structure
id date value
-------------------------
1 22/08/2006 48
1 24/08/2006 50
1 28/08/2006 150
1 30/08/2006 100
1 01/09/2006 30
2 11/08/2006 30
2 22/08/2006 100
2 28/08/2006 11
2 02/09/2006 5
3 01/07/2006 3
3 01/08/2006 100
3 01/09/2006 100
4 22/08/2006
2007 Dec 03
1
help on qcc
Hello R Experts,
I started to work with the qcc package and it wprks quite nicely.
Heres My Code:
n <-
c(55,5,94,25,10,15,15,40,44,34,90,114,204,37,30,28,12,68,64,29,24,14,31,16,62,45,55,20,24,14,9,19,76,57,55,42,6,
54,32,117,19,32,9,11,13,31,27,33,44,28)
x <- c(6,0,30,5,2,1,4,5,2,9,12,24,64,3,9,21,9,48,15,4,3,0,1,0,6,
7,2,0,3,2,0,5,1,2,6,9,1,6,2,0,1,4,8,0,1,1,3,0,0,0)
2009 Jan 22
2
How to Run R Programs in a Scheduled Way
Hello R Experts,
does anyone know how to run R programs automatically using the window
scheduler?
I want to run some R programs automatically and make the results available
via web.
Mit freundlichen Grüßen / Best Regards / С наилучшими пожеланиями /
üdvözlettel
Thorsten
[[alternative HTML version deleted]]
2005 Apr 19
2
RODBC odbcCloseAll odbcClose Windows XP
Hello...
After installing the precompiled version of R 2.1.0 (congratulations
to the R Development Core Team) for Windows XP (Service Pack 2), I'm
having problems with the "odbcCloseAll" and "odbcClose" functions
within the "RODBC" package. I get pretty much the same error message
for both functions:
odbcCloseAll() produces:
Error in
2009 Nov 18
3
Re ading multiple Excel 2007 files with a loop
I have several hundred Excel 2007 data files in a folder. I would like to
read every file in a single given folder using a loop.
I have searched the FAQ, the forum archives here, other or older R boards
and the R Import / Export documentation, and have asked some very
knowledgeable R users without learning of a solution. I hope someone here
can help.
I understand that the most common
2006 Sep 19
1
RODBC Connections closed automatically in background
I am having a problem with RODBC's connections. It appears that
my connection to the database is closed by R automatically before
I am done with it.
Here is my code:
foo <- function(dsn) {
db <- odbcConnect(dsn)
odbcSetAutoCommit(db, FALSE)
data <- someDatabaseOperation(db)
data2 <- someLongCalculation(data)
anotherDatabaseOperation(db, data2) # This often fails b/c the
2007 Mar 06
2
Package RODBC
I have some questions about the RODBC package.
library(RODBC) # required for those who want to repeat these lines
1st, I noticed that the following sequence does not work:
channel <- odbcConnextExcel("test.xls")
tables <- sqlTables(channel)
name1 <- tables[1, "TABLE_NAME"] # this should be the name
plan1 <- sqlFetch(channel, name1) # bang!
2006 Oct 18
2
sqlSave, fast=F option, bug?
Hi,
Using the fast=F option, sqlSave saves without matching column names.
It looks like a bug to me..........
Here's a simple (artificial) example.
-----------------------------------------
Create a dataframe and save it to a database table "test" as follows:
df <- data.frame(T=1, S=10)
sqlSave(channel, df, "test", rownames=F)
The table now looks like
T S
1 10
If
2011 Feb 10
2
Rioja package, creating transfer function, WA, "Error in FUN"
Hi, I am a new R user and am trying to construct a palaeoenvironmental
transfer function (weighted averaging method) using the package rioja.
I've managed to insert the two matrices (the species abundance and the
environmental data) and have assigned them to the y and x values
respectively. When I try and enter the 'WA' function though, I get an 'Error
in FUN' message (see
2001 May 14
1
RODBC: closing databases
Dear all,
platform i386-pc-mingw32
arch x86
os Win32
system x86, Win32
status
major 1
minor 2.3
year 2001
month 04
day 26
language R
I wrote the following to import tables in different database formats
(Access, Visual FoxPro, etc.):
getTable <-
2006 Mar 18
1
The R "fork"
Hello, I would like to call a function that can take infinite time to
be executed in some circumstances (which can not be easily detected).
So, I would like that once the function is being executed for more
than two seconds it is stopped. I have found documentation for timers
but i did not found how to "kill" a function. Moreover, I would like
not to change the function code (it should
2006 Aug 31
2
Consulta sobre bases en R
Estimados,
Quisiera saber cuanto es el tamaño máximo de datos contenidos en mi base de
datos, que el software R puede llegar a procesar y soporta.
De antemano agradezco y envió un cordial saludo.
Marcela Corrales
CPData Optimum
[[alternative HTML version deleted]]
2007 Apr 19
2
element search
Dear R-experts,
I have got an excel file as attached. I imported it successful with the
commands:
library(RODBC)
channel <- odbcConnectExcel("data2.xls")
tables <- sqlTables(channel) # list the names of the spreadsheets
name1 <- tables[1, "TABLE_NAME"] # get the name of the 1st spreadsheet
plan1 <- sqlQuery(channel, sprintf("select * from [%s]",
2012 May 29
1
RODBC, Excel, and data truncation when writing
Hi,
I am hoping to use the RODBC package to write a dataframe to an Excel .xlsx
file. The dataframe contains at least one field with character elements
that exceed 255 bytes, which appears to be the cell width limit in Excel.
Below is example code and the warning message received:
library(RODBC)
d <-