[R-SIG-Mac] download R 3.2.1 on mac OS

David Winsemius dwinsemius at comcast.net
Fri Aug 26 04:42:11 CEST 2016


> On Aug 25, 2016, at 7:11 PM, Valentina Blohm Crenovich <vblohm at fen.uchile.cl> wrote:
> 
> *Hello!*
> 
> *I have the following error system Mac OS 10.6.8 R 3.2.1 :*
> 
> 
> *>fileUrl<-
> "https:data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD
> <http://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD>"*

I'm not sure this is really a mac question but since there is a mac issue with downloading that I have solved with package::download I offer this suggestion. Need to know your working or target directory name (or create it with path.expand) since download.file does not do path expansion.


Also note that your url is either malformed or at the very least confusing. Cannot tell if it is https: or http:. Should just be:


fileUrl <-
"http://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"

# Then with downloader installed and assuming that a ./data/ subdirectory exists:

library(downloader)
download( fileUrl, destfile=path.expand("./data/cameras.csv")

Note that it would be more typical on a Mac to see "~/" than "./" or to see a setwd("./data") call.

-- 
David.

> 
> *> download.file(fileUrl, destfile="./data/cameras.csv",method="curl")*
> 
> *curl: (6) Warning message:*
> *In download.file(fileUrl, destfile = "./data/cameras.csv", method =
> "curl") :*
> *  download had nonzero exit status*
> *Couldn't resolve host 'https:data.baltimorecity.gov
> <http://data.baltimorecity.gov>'*
> 
> Thank you
> Tina
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

David Winsemius
Alameda, CA, USA



More information about the R-SIG-Mac mailing list