Skip to content

download R 3.2.1 on mac OS

7 messages · Valentina Blohm Crenovich, Richard M. Heiberger, Hodgess, Erin +2 more

#
*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>"*

*> 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
#
try

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

On Thu, Aug 25, 2016 at 10:11 PM, Valentina Blohm Crenovich
<vblohm at fen.uchile.cl> wrote:
#
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.
#
thanks, it helps a lot but I get the following instead of downloading:

100  9443  100  9443    0     0  26789      0 --:--:-- --:--:--
--:--:-- 46517     0      0 --:--:-- --:--:-- --:--:--     0
, also I tried
and the output is:

100  9443  100  9443    0     0   7196      0  0:00:01  0:00:01
--:--:-- 65576      0 --:--:--  0:00:01 --:--:--     0
Valentina Blohm

Estudiante de Econom?a
Facultad de Econom?a y Negocios
Universidad de Chile


2016-08-25 22:42 GMT-04:00 David Winsemius <dwinsemius at comcast.net>:
#
Hi Valentina:

That's ok...that's how it downloads.

If you do
file.show("cameras.csv")

you will see your file



Erin M. Hodgess
Associate Professor
Department of Mathematics and Statistics
University of Houston - Downtown
mailto: hodgesse at uhd.edu
#
That's not an error message.

It's actually telling you that you got 9443 bytes. If the first number were 0, then you would be concerned (and you would have seen some sort of error message).
#
On 25/08/2016 11:03 PM, Valentina Blohm Crenovich wrote:
If you saw messed up output like that, you're probably using RStudio, 
which doesn't display download.file output properly.  In other front 
ends this would appear as a progress report.

Duncan Murdoch