Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread Gabor Grothendieck
Also you have to be very careful. e.g. > BOD Time demand 118.3 22 10.3 33 19.0 44 16.0 55 15.6 67 19.8 > attach(BOD) > Time <- Time + 1 > BOD # oops! BOD was not changed Time demand 118.3 22 10.3 33 19.0 44 16.0 55 15.6 6

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread hadley wickham
>> From: hadley wickham >> >> Don't use attach? > > Obvously good advice but why? Philosophically, it's better to be explicit than implicit, and the extremely non-local effects of attach can make debugging difficult. Hadley -- http://had.co.nz/ __

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread RICHARD M. HEIBERGER
If you are starting with an Excel file, then you should have R read the xls file directly. You should avoid the distortions often introduced by an intermediate format such as .txt or .csv files. I recommend using RExcel. You can get it from CRAN with install.packages("RExcelInstaller") library(R

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread A Singh
Thanks a huge bunch John, David, Steve, Hadley and Erik! I don't know how acceptable it is to mass thank everyone :), but seemed like a good idea as everyone was in on the thread and here's how it worked: Unmatched quotes was probably correct. When exporting from excel, it did warn me that the

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread John Kane
--- On Mon, 9/21/09, hadley wickham wrote: > From: hadley wickham > > Don't use attach? Obvously good advice but why? __ The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread John Kane
vcl. Try head(vcl) str((vcl) class(vcl) and see if you can display the file (head()) and get some idea of the structure from str() and class() --- On Mon, 9/21/09, A Singh wrote: > From: A Singh > Subject: Re: [R] Working around 256 byte variable names? + trouble opening > l

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread David Winsemius
Read in the first few lines with readLines, try to "eyeball" the errors and if not successful, then supply them to read.table through a textConnection. Remember that single quotes do not match double quotes. Also watch out for "smart-quotes". I don't think they match anything. ?readLines

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread hadley wickham
On Mon, Sep 21, 2009 at 3:04 PM, A Singh wrote: > Dear R users, > > I am trying to read in a file with 105 columns, and when trying to attach > it, get an error as follows: > >> vc1<-read.table("P:\\R\\Everything-I.txt", header=T, sep=" ", dec=".", > > na.strings=NA, strip.white=T) >> >> attach(vc

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread Erik Iverson
> I did just try to do that, and it is still returning the same error when I > try to attach the csv file.. > > > vc1<-read.table("P:\\R\\Everything-I.csv",header=T, sep=" ", dec=".", > na.strings=NA, strip.white=T) > > attach(vc1) > Error in attach(vc1) : variable names are limited to 256 bytes

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread Steve Lianoglou
Hi Aditi, On Sep 21, 2009, at 4:04 PM, A Singh wrote: Dear R users, I am trying to read in a file with 105 columns, and when trying to attach it, get an error as follows: vc1<-read.table("P:\\R\\Everything-I.txt", header=T, sep=" ", dec=".", na.strings=NA, strip.white=T) attach(vc1) E

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread A Singh
:) Well that does make even more sense. Is there a way of fixing the unmatched quote problem though? I do not have any clue as to how it can be done. Will remaking the original file, and then re-reading it in help? --On 21 September 2009 16:17 -0400 David Winsemius wrote: On Sep 21, 200

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread A Singh
re header line as one variable. Why not try exporting the Exce file as a csv file and loading that? --- On Mon, 9/21/09, A Singh wrote: From: A Singh Subject: [R] Working around 256 byte variable names? + trouble opening large file To: r-help@r-project.org Received: Monday, September 21,

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread David Winsemius
On Sep 21, 2009, at 4:04 PM, A Singh wrote: Dear R users, I am trying to read in a file with 105 columns, and when trying to attach it, get an error as follows: vc1<-read.table("P:\\R\\Everything-I.txt", header=T, sep=" ", dec=".", na.strings=NA, strip.white=T) attach(vc1) Error in at

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread John Kane
, A Singh wrote: > From: A Singh > Subject: [R] Working around 256 byte variable names? + trouble opening large > file > To: r-help@r-project.org > Received: Monday, September 21, 2009, 4:04 PM > Dear R users, > > I am trying to read in a file with 105 columns, and wh

[R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread A Singh
Dear R users, I am trying to read in a file with 105 columns, and when trying to attach it, get an error as follows: vc1<-read.table("P:\\R\\Everything-I.txt", header=T, sep=" ", dec=".", na.strings=NA, strip.white=T) attach(vc1) Error in attach(vc1) : variable names are limited to 256 byt