[R-SIG-Mac] Some introductory questions

Mike Feher m|eher1971 @end|ng |rom gm@||@com
Tue Sep 8 00:04:47 CEST 2020


Hi Peter,

Here is a snippet of the code I was trying to start with:

filepath1 <- file("/Users/michaelfeher/Documents/R
Documents/COVID19/20200906-1822-total-cases-jones.data")
filepath1
TotalCasesJones <- read.table(filepath1)

This definitely did not work for me.

Mike

On September 7, 2020 at 3:50:19 AM, peter dalgaard (pdalgd using gmail.com) wrote:



> On 7 Sep 2020, at 07:09 , Ken Beath <ken using kjbeath.com.au> wrote:
>
>> On 7 Sep 2020, at 9:31 am, Mike Feher <mfeher1971 using gmail.com> wrote:
>
[snip]
>> 4. I tried to read in a set of dummy space-delimited data saved in an
>> absolute path on my computer, but it would not work. I tried something
in
>> another path that did not have a subfolder with a space in it (I.e. I
plan
>> on storing my data in a folder called “R Documents” or something
similar)
>> and that didn’t work either, so I’m still wondering whether or not (a)
>> things have to be in the library location (it seems like you could
>> customize that) and (b) whether R recognizes spaces in file paths.
>>
>
> Try using file.choose() to locate files using a dialog and it will return
the full name. Spaces shouldn’t matter provided that everything is enclosed
in quotes. Most people don’t use absolute references. They set the working
directory and then just use the name of the file. See under the Misc menu.

Also, how do you "read in" the data? Usually, read.table() or somesuch
would be involved, although RStudio has an "Import data" functionality.

-pd

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes using cbs.dk Priv: PDalgd using gmail.com

	[[alternative HTML version deleted]]



More information about the R-SIG-Mac mailing list