marinebon / infographiqR

R functions for creation of interactive intelligent infographics, ie infographiq
https://marinebon.github.io/infographiqR
MIT License
11 stars 2 forks source link

Program crashes #29

Open reikopm opened 6 years ago

reikopm commented 6 years ago

Intermittently with this error message: Error in file.copy(from = file.path(input, files), to = output_dir, recursive = TRUE) : more 'from' files than 'to' files In addition: There were 12 warnings (use warnings() to see them)

warnings() Warning messages: 1: In dir.create(output_dir) : cannot create dir 'C:\Users\reiko\Documents\gitrepos\info-mb\rmd..\docs', reason 'Permission denied' 2: In dir.create(output_lib_dir) : cannot create dir 'C:\Users\reiko\Documents\gitrepos\info-mb\rmd..\docs\site_libs', reason 'No such file or directory' 3: In file.copy(file.path(lib_dir, lib), output_lib_dir, ... : 'recursive' will be ignored as 'to' is not a single existing directory 4: In file.create(to[okay]) : cannot create file 'C:\Users\reiko\Documents\gitrepos\info-mb/rmd/../docs/site_libs', reason 'No such file or directory'

7yl4r commented 6 years ago

I haven't seen this before. Those file paths don't look very windows-friendly, so I am guessing this is probably a windows compatibility issue.

I don't have a windows machine handy to test this, but the fix may be as simple as fixing some path strings. I'll have to figure out how to say os.path.join in R though. :smile:

reikopm commented 6 years ago

I think you are right that it is a windows problem, but I also think it might have something to do with github. I'm using RStudio. And R v 3.4.1

I'll look into the path string problem. Thanks -R

bbest commented 6 years ago

Hi @reikopm,

You'll need to update the path. Unfortunately Windows chose to use the backslash \ as a path separator, which for the rest of the computing world has been reserved as the escape character to construct things like newline \n, tab \t or similar. So you'll need to do 1 of 2 things:

  1. Replace backslashes \ with forwardslashes /, the otherwise universally understood path separator. I recommend this strategy.

  2. Escape the escape character by replacing backslashes \ with escaped backslashes \\. This looks messier to me.

You can also use file.path() (eg file.path('dira','dirb','file.txt')) to construct a path (eg 'dira/dirb/file.txt').

7yl4r commented 6 years ago

@reikopm please try using the latest infographiq and let us know if that fix I just pushed helps.