[R] here Package

Jeff Reichman re|chm@nj @end|ng |rom @bcg|ob@|@net
Mon Oct 18 01:08:16 CEST 2021


Andrew

 

Thank you so much. That was an easy fix. 

 

I you have some time I’d like some more info on the close function close(con)

 

Jeff

 

From: Andrew Simmons <akwsimmo using gmail.com> 
Sent: Sunday, October 17, 2021 3:35 PM
To: reichmanj using sbcglobal.net
Cc: R-help Mailing List <R-help using r-project.org>
Subject: Re: [R] here Package

 

You've just got the brackets in the wrong spot:

 

 

creditsub <- read.csv(unz(here::here("Data.zip"), "creditcardsub.csv")) 

 

instead of

 

creditsub <- read.csv(unz(here::here("Data.zip", "creditcardsub.csv"))) 

 

 

Also, you probably want to save that connection and close it manually.

 

 

creditsub <- read.csv(con <- unz(here::here("Data.zip"), "creditcardsub.csv")) ; close(con)

 

 

I hope this helps! 

 

On Sun, Oct 17, 2021 at 4:23 PM Jeff Reichman <reichmanj using sbcglobal.net <mailto:reichmanj using sbcglobal.net> > wrote:

R-help



I have a R project that contains an R Notebook and I am trying to use the
"here" function  to access a file.  Before using R projects file I would set
the working dir in a R setup chunk and run the following command (for
example)



creditsub <- read.csv(unz(Data.zip", "creditcardsub.csv"))



This works just fine but I'm trying to see if I can use the here function
now but no luck. I sort of assumed it would be something like 



creditsub <- read.csv(unz(here::here(Data.zip", "creditcardsubcsv"))) -
nope. I've also tried placing it in other locations  still no luck so I'm
wondering if I can even use it in this application



Jeff




        [[alternative HTML version deleted]]

______________________________________________
R-help using r-project.org <mailto:R-help using r-project.org>  mailing list -- To UNSUBSCRIBE and more, see
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.


	[[alternative HTML version deleted]]



More information about the R-help mailing list