[R] using read.table, removing extra quotation mark from a text field? (e.g. ""cat" )

2010-09-12 Thread Eva Nordstrom
I am using read.table to import a text file within R.   There are several "errors" in my text file.  An "extra" quotation mark has inadvertently been included within a few text fields.   e.g. for a pipe (|) delimited text file, I have something similar to this:   1|7|30| "dog" 2|6|25| ""cat" 3|4

[R] "easiest" way to write an R dataframe to excel?

2010-08-23 Thread Eva Nordstrom
I am using R 2.11.1 in a Microsoft Windows 7 environment.   I tried using WriteXLS, but get the message " In system(cmd) : perl not found"   What is the "easiest" way to write an R dataframe to Excel?  (I am familiar with WriteXLS, but I do not have PERL installed, and if not needed, do not wish

[R] loading a package within R, in a MS Windows environment?

2010-08-20 Thread Eva Nordstrom
I am using R 2.11.1 in a Microsoft Windows environment. Is there a way to load a package (e.g. the zoo package) using only "written code", not menus or mouse clicks? The "code" below code brings up the "Select One" [package] menu.  I just want to automatically load the "zoo package".  local(

[R] variation of the aggregate function

2010-08-13 Thread Eva Nordstrom
Is there a "more efficient/elegant" way to obtain the result "z" below. a <- c('pink','pink','blue','blue','gold','gold') b <- c(5,8,9,12,7,4) agg <- aggregate(x=b,by=list(a), FUN='mean') m <- match(a, agg[,1]) z <- agg[m,2] z [[alternative HTML version deleted]] ___