Trouble with posting slidify to Dropbox - r

I created a slidify slideshow, but when I am trying to drop in into my dropbox account into Public folder I get a warning:
publish("Slides", host = "dropbox")
Creating slide directory at ~/Dropbox/Public/Slides
Copying files to ~/Dropbox/Public/Slides
[1] FALSE
Warning messages:
1: In file.copy(".", drop_dir, overwrite = F, recursive = TRUE) :
'recursive' will be ignored as 'to' is not a single existing directory
2: In file.create(to[okay]) :
cannot create file '~/Dropbox/Public/Slides', reason 'No such file or directory'
I tried to create a hard symbolic link as http://thiagosilva.wordpress.com/2013/02/17/installing-slidify-on-a-windows-machine/ suggests.
But the warning is still there...
Any ideas?
Best Regards!

Related

R Raster error: Cannot create a RasterLayer object from this file. (file does not exist)

Trying to pull in and scale a Landsat image but receive an error, this seems to be a somewhat common issue given the older questions and various ways of creating a RasterLayer object.
After loading the libraries I need I get to this and hit an issue:
Directory <- "D:/Geo Files/LANDSAT"
prefix <- "CU_LC08.001_"
suffix <- "_doy2020222_aid0001.tif"
## Get band 2 reflectance (blue, 0.45-0.515 micron)
sr2 <- raster(paste0(Directory,prefix,"SRB2",suffix))
Error in .local(.Object, ...) :
*Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
Cannot create a RasterLayer object from this file. (file does not exist)*
> sr2 = sr2*0.0001 #Scale
Error: object 'sr2' not found
The full name of the first (SRB2) file I want to use is:
CU_LC08.001_SRB2_doy2020222_aid0001.tif - the name of the file as it's downloaded, unchanged.
The rest of the code continues through the other files to go through each SRB and later calculate NDVI, etc
i.e. ## Get band 3 reflectance (green, 0.533-0.590 micron) sr3 <- raster(paste0(Directory,prefix,"SRB3",suffix)) sr3 = sr3*0.0001 #Scale
Edit 1: I tried using try using \ instead of forward slashes and got exactly the same error.
R version is R-4.0.3
Any help would be appreciated, this was provided to us in a hackathon and I am new to R, it should be simple to run but if the file cannot be read..?
EDIT 2: The issue was with the end of the path, it needed "\"
Directory <- "D:\\Geo Files\\LANDSAT\\"
But when trying to get another file to work from a different folder later in the code, the same issue appears, and the above fix did nothing:
Directory <- "D:\\Geo Files\\ECOSTRESS\\USCities\\"
LST_ECO <- raster(paste0(Directory,"SDS_LST_doy2020260040819_aid0001.tif"))
Error in .local(.Object, ...) :
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", :
Cannot create a RasterLayer object from this file. (file does not exist)
EDIT 3: Changed \Geo Files\ to "\GeoFiles\" as suggested, tried again but problem still occurs as above.
I had the same issue and the following was the process that finally worked.
# location of the file
loc_1 = "D:\\Geo Files\\ECOSTRESS\\USCities\\SDS_LST_doy2020260040819_aid0001.tif"
# check if the file can be read into r
tif1 = readr::read_file(loc_1)
It raised the following error (edited):
Error: Cannot read file "D:\\Geo Files\\ECOSTRESS\\USCities\\SDS_LST_doy2020260040819_aid0001.tif": The cloud file provider is not running.
The reason was because R could not read the file as it was in an online folder.
Confirm if the file is available offline. If it can be read by read_file function then the raster function should work.
I had the same issue
i was loading a raster file from my local storage
I added ".tif" extension to the name of the file and it worked

How to deal with errors for loading a rdata file?

I need the data of the .rdata file for text mining. These are my dataset. I don't know exactly what's in that file. The problem is i can't load it.
I tried to open the file with different windows computers but with the same errors. I used RStudio in the updated version. I google the error-Information but nothing worked. Because I can open other rdata files there should be no registry problem. I wanted to check in an other basic windows Editor to look what is in the file but there were only signs like: ‹ ìùuPo³6
’#p ÜÝ‚»»»[pw—…»»»»»†àînÁuA°E`!‡ßûîýí}æÌLMÕÌùæŸÝõTñÈ}÷ÝrõÕ½
¢hXˆ
I tried different possibilities to open the file in RStudio with different error informations as followed:
with load()
require("readr")
setwd("C:/Users/..")
options(stringsAsFactors = F)
load("file")
# Error in load("file") :
# bad restore file magic number (file may be corrupted) -- no data loaded
# In addition: Warning message:
# file ‘.rdata’ has magic number ''
# Use of save versions prior to 2 is deprecated
with source()
require("readr")
setwd("C:/Users/..")
options(stringsAsFactors = F)
source("file")
# Error in source("file") :
# file.rdata:1:1: unexpected input
# 1:
# ^
readRDS
setwd("C:/Users/..")
options(stringsAsFactors = F)
readRDS("file")
# Error in readRDS("file") : unknown input format

Why does dir.create give cannot create dir 'results', reason 'No such file or directory'?

After run my analysis I tried to create a new folder and save my results. I got the message:
dir.create("results")
Warning message:
In dir.create("results") :
cannot create dir 'results', reason 'No such file or directory'
In case you want to create a new nested directory, e.g. "D:/mytest/myresults", wehre D:/mytest needs to be created as well as the subdirectory /myresults, dir.create() will not work when you use:
dir.create("D:/mytest/myresults")
Becasue "D:/mytest" does not exist, you cannot create "D:/mytest/myresults" and you will receive the warning:
In dir.create("D:/mytest/myresults") : cannot create dir
'D:\mytest\myresults', reason 'No such file or directory'
Use recursive = TRUE insted:
dir.create("D:/mytest/myresults", recursive = TRUE)
Using recursive = TRUE is equivalent to creating the base directory first and the subdirectory after that, like:
dir.create("D:/mytest")
dir.create("D:/mytest/myresults")

How to eliminate security concern while accessing to the file through program in R in Windows?

While accessing to CSV file from disk with the help of the R program, where a path to the CSV file is provided in the configuration file ( A path is like "testData/Amazon S3/Inventory/Accounts.csv" which is provided in the Configuration file and cfig[2]$save.location is variable who is having value of this path accessed from Configuration file). Few lines of code are below
path <- cfig[2]$save.location
test_data <- fread(path,stringsAsFactors = FALSE,drop=col_ignor,blank.lines.skip = TRUE)
but it gave the message below:
Taking input= as a system command ('testData/Amazon
S3/Inventory/Accounts.csv') and a variable has been used in the
expression passed to input=. Please use fread(cmd=...). There is a
security concern if you are creating an app and the app could have a
malicious user and the app is not running in a secure environment;
e.g. the app is running as root. Please read item 5 in the NEWS file
for v1.11.6 for more information and for the option to suppress this
message.
'testData' is not recognized as an internal or external
command, operable program or batch file. Warning messages:
1: In (if
(.Platform$OS.type == "unix") system else shell)(paste0("(", :
'(testData/Amazon S3/Inventory/Accounts.csv) >
C:\Users\sharmb5\AppData\Local\Temp\RtmpOa25kH\filea78b5351f1'
execution failed with error code 1.
2: In fread(cfig[2]$save.location,
stringsAsFactors = FALSE, drop = col_ignor, : File
'C:\Users\sharmb5\AppData\Local\Temp\RtmpOa25kH\filea78b5351f1' has
size 0. Returning a NULL data.table.
when the following line of code executes,
config[4]$save.location <- stri_replace_all(config[4]$save.location, cp_val, fixed = cp_key)
It gives an error like as, Error in [<-.data.table(*tmp*, j, value = list(TestCaseID = "C419760", : Supplied 14 columns to be assigned 15 items. Please see NEWS for v1.12.2.
The above error was a warning but after manually updating of packages. This warning turns into an error. What will be the reason behind this issue and how to solve it? Thanks for Advance!!!

Uploading a model to synapse

I tried to upload a data model to Synapse, and I got the following error message (from remote console):
Error in if (grepl("/$", filePath)) { : argument is of length zero In
addition: Warning messages: 1: In file.copy(object$getCacheDir(),
path, recursive = TRUE) : problem creating directory
/home/creighto#bcm.edu/scratch/tmp/RtmpHjLEQh/cacheRoot5e4dbe7c02d/archive.zip_unpacked/.R_OBJECTS:
No space left on device 2: In unzip(filename, exdir = destdir) : error
1 in extracting from zip file.
Also my directory has frozen up, and I cannot seem to access files. Have I exceeded a space limit here?
Sorry to state the obvious, but it does look like you've ran out of space: you can't unzip file due to space, so you can't create a directory. Can you reduce the file size?

Resources