search for: aydemir

Displaying 10 results from an estimated 10 matches for "aydemir".

2007 Oct 18
2
error: unused arguments
Hi what does this mean when i get above error? When I call function foo(), specifying parameters a and b as below a<-5 b<-6 > y <- foo(a,b) > Error in foo(a, b) : unused argument(s) (6) Thanks Zava -------------------------------------------------------- This is not an offer (or solicitation of an offer) to bu...{{dropped:24}}
2007 Jul 03
2
vertically concatenating data frames
Hi, what is the recommended way to vertically concatenate 2 data frames with the same column names but different number of rows? My problem is something along these lines: df1 <- data.frame(var1=var1,var2=var2,var3=var3) # nrow(df1)=1000 df2 <- data.frame(var1=var4,var2=var5,var3=var6) # nrow(df2)=2000 I tried df <- c(df1,df2), no success. stack does not seem to be appropriate
2007 Jul 12
2
lead
Hi, is there any function in R that shifts elements of a vector to the opposite direction of what Lag() of the Hmisc package does? (something like, Lag(x, shift = -1) ) Thanks Zava -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
2007 Jul 17
2
poor rbind performance
Hi I rbind data frames in a loop in a cumulative way and the performance detriorates very quickly. My code looks like this: for( k in 1:N) { filename <- paste("/tmp/myData_",as.character(k),".txt",sep="") myDataTmp <- read.table(filename,header=TRUE,sep=",") if( k == 1) { myData <- myDataTmp } else{ myData
2007 Jun 14
2
connecting to DB2 database
Hi, i am trying to connect to a DB2 server using the DBI library. getData <- function() { driver <- dbDriver("DB2") conn <- dbConnect(driver,"server","uname","pword") data <- dbSendquery(conn, "select etc.") } When I run the function, i get the error > data <- getData() Error in
2007 Jul 02
1
compute time span in months between two dates
Hi, I am just starting to play with R. What is the recommended manner for calculating time spans between 2 dates? In particular, should I be using the "chron" or the "date" package (so far I just found how to calculate a timespan in terms of days)? Thanks Zava -------------------------------------------------------- This is not an offer (or solicitation of an offer) to
2007 Jul 05
1
converting list to an array
Hi, I have a list myList (see below) that consists of id's $'7',....,$'10' and each id has an individual array, the length of which can vary from id to id. How can I convert this list into an array, ie. stacking the individual arrays into one large array? Thanks Zava myList: $`7` [1] 20050201 20050301 20050401 20050501 $`8` [1] 20050201 20050301 20050401
2007 Jul 05
1
generating lower triangular matrix
Hi, I would like to generate below triangular matrix for some a. 0 0 0 0 0 0 1 0 0 0 0 0 a 1 0 0 0 0 a^2 a 1 0 0 0 a^3 a^2 a 1 0 0 a^4 a^3 a^2 a 1 0 What's an efficient way to do this? (this matrix being KxK, K very large) Thanks Zava -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
2007 Jul 18
1
passing a parameter to a file from command line
Hi, I have a file fileFoo.R, say that contains these two lines, invoking function foo that is specified in "foo_details.R": source("foo_details.R") foo(parameter1) I want to specify and pass parameter1 in my command line when invoking R in linux: R --no-save <fileFoo.R. How can I do that? And how can I retrieve the value of parameter1 in my fileFoo.R function
2007 Jun 14
0
connecting to db2 via RJDBC
Hello, I seem to have issues with setting the driver: My code: library(RJDBC) getStatic <- function() { # set driver driverClass <- JDBC("com.ibm.db2.jcc.DB2Driver","someClassPath.jar","'") conn <- dbConnect(driverClass,"serverName") etc etc } I get this error > data <-getData()