Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission Denied Error when downloading a file

Tags:

r

I am trying to download an excel zip file into a R Project folder that I have started. I'm new to R so I'm a little puzzled at the error message that I'm receiving.

The file is an excel file and so first I created a variable for the file:

excel2file="http://op.nsf.data/dataFiles/Housing2013EXCEL.zip"

Then I used the coding:

download.file(excel2file, destfile= "~/Home/Documents/Data")

I receive this error message:

Error in download.file(excel2file, destfile = "~/Home/Documents/Data") : 
  cannot open destfile '~/Home/Documents/Data', reason 'Permission denied'

I tried looking at other examples of permission denied and I think it may be my destination file but I am not sure why or the steps to trouble shoot it.

like image 817
SCalabre Avatar asked Nov 05 '14 19:11

SCalabre


People also ask

How do I fix access denied downloads?

Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see the permissions that you have. Click Edit, click your name, select the check boxes for the permissions that you must have, and then click OK.

What does it mean when it says permission denied?

A "Permission denied" error means that the server rejected your connection.


1 Answers

destfile should be a filename, not a directory. For example:

download.file(excel2file, destfile= "~/Home/Documents/Data/Housing2013EXCEL.zip")

Also, that URL doesn't seem to be valid, but that's a different (non-R) problem.

like image 185
Thomas Avatar answered Sep 24 '22 06:09

Thomas