Could you replace 'system' with 'pipe' and read directly from the pipe connection rather than the intermediate step of having a text string? If the external function just returns the numbers with commas and spaces (but no line feeds), then you should be able to use 'scan' directly on the connection.
Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Robin Hankin > Sent: Monday, March 19, 2007 5:20 AM > To: Peter Dalgaard > Cc: RHelp help; Robin Hankin > Subject: Re: [R] character to numeric conversion > > Hello everybody > > thanks for the tips. > > I *think* this should be the same thread.... > > > The manpage for system() says that lines of over 8095 > characters will be split. This is causing me problems. > How do I get round the 8095 character limit? > > > Simple toy example follows: > > > > jj <- system("echo 4 | awk '{for(i=1;i<100;i++){printf(\"%s,\", > $1)}}'| sed -e \"s/,$//\"",intern=T) > > > This is fine. But .. . . > > > jj <- system("echo 4 | awk '{for(i=1;i<10000;i++){printf(\"%s,\", > $1)}}'| sed -e \"s/,$//\"",intern=T) > > > > has "jj" split into three bits, which is upsetting my call. In my > application > the split occurs in the middle of a multi-digit number, which > messes up > my conversion to numeric? > > > > > > > > -- > Robin Hankin > Uncertainty Analyst > National Oceanography Centre, Southampton > European Way, Southampton SO14 3ZH, UK > tel 023-8059-7743 > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
