Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread William Poling, Ph.D., MPH via R-help
Hi Kevin. Maybe? setwd("C:/RPractice") write_csv(yourfile, path = "yourfile.csv") yourfile <- read.csv("yourfile.csv") HTH WHP On Monday, July 9, 2018, 10:42:24 AM EDT, Kevin Thorpe wrote: Hi. I have some data frames I created previously that seem to not be working correctly anymore.

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread Kevin Thorpe
Lana School of Public Health University of Toronto email: kevin.tho...@utoronto.ca  Tel: 416.864.5776  Fax: 416.864.3016 From: Jeff Newmiller Sent: Monday, July 9, 2018 1:01 PM To: r-help@r-project.org; Kevin Thorpe; R Help Mailing List Subject: Re: [R] Using write.csv as a connection f

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread Jeff Newmiller
TL;DR: If you want to do this, go ahead and use a temporary file or text connection. Others have pointed out that write.csv returns NULL rather than a file connection, but I haven't seen comments on your impulse to avoid the use of files. *nix operating systems are admirably efficient with mul

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread William Dunlap via R-help
>I tried something like read.csv(write.csv(df,row.names=FALSE)) but got the error > > Error in read.table(file = file, header = header, sep = sep, quote = quote, : > 'file' must be a character string or connection To diagnose this without reading the help(write.csv) look at the return value of

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread David Winsemius
16.864.3016 > > > > > > From: R-help on behalf of Kevin Thorpe > > Sent: Monday, July 9, 2018 11:17 AM > To: Eric Berger > Cc: R Help Mailing List > Subject: Re: [R] Using write.csv as a connection for read.csv > > > Although your suggestion to prov

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread Kevin Thorpe
p on behalf of Kevin Thorpe Sent: Monday, July 9, 2018 11:17 AM To: Eric Berger Cc: R Help Mailing List Subject: Re: [R] Using write.csv as a connection for read.csv   Although your suggestion to provide the data is excellent and one I typically agree with, they data are currently unpublished a

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread Bert Gunter
Michael's > Assistant Professor, Dalla Lana School of Public Health > University of Toronto > email: kevin.tho...@utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016 > > > From: Eric Berger > Sent: Monday, July 9, 2018 10:51:38 AM > To: Kevin

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread Kevin Thorpe
to.ca Tel: 416.864.5776 Fax: 416.864.3016 From: Eric Berger Sent: Monday, July 9, 2018 10:51:38 AM To: Kevin Thorpe Cc: R Help Mailing List Subject: Re: [R] Using write.csv as a connection for read.csv Hi Kevin, It's good that you provided the background to the

Re: [R] Using write.csv as a connection for read.csv

2018-07-09 Thread Eric Berger
Hi Kevin, It's good that you provided the background to the problem. Rather than asking this list to "debug" your proposed solution, I think you would be better off showing some of the "corrupted" data frame and ask for suggestions how to deal with it. (Suggestions may or may not match your initial

[R] Using write.csv as a connection for read.csv

2018-07-09 Thread Kevin Thorpe
Hi. I have some data frames I created previously that seem to not be working correctly anymore. I *think* the problem is that some of the variables in the data frame are of a type called labelled. There are other attributes in the data frame as well. I thought that the easiest way to fix this w