CfSOtago/GREENGridData

Failed to install 'GREENGridData' from GitHub

RaffertyP opened this issue · 9 comments

I'm getting a non-zero exit status when trying to install onto a Windows machine. I have not had this issue when previously installing on Linux.

NOTE: I am not using the most recent versions of digest or data.table. The most recent versions of these two packages require compiling from source which is proving difficult. I have the most recent binary versions of these packages installed. I don't think this would be the problem but it may be.

My guess is that when the required data files are called using the the read.table() function the 'slashes' in the directory path are facing the 'wrong' way, i.e. for Unix filesystems.

I have pasted the Console output below. I'll keep working on a fix and report back once successful, but in the meantime let me know if you have any ideas.

devtools::install_github("CfSOtago/GREENGridData")
Downloading GitHub repo CfSOtago/GREENGridData@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?

1: All
2: CRAN packages only
3: None
4: digest (0.6.25 -> 0.6.26) [CRAN]
5: data.table (1.13.0 -> 1.13.2) [CRAN]

Enter one or more numbers, or an empty line to skip updates:3
√ checking for file 'C:\Users\ParkerR\AppData\Local\Temp\RtmpSeTpqr\remotes53407a2343e8\CfSOtago-GREENGridData-3417279/DESCRIPTION' ...

  • preparing 'GREENGridData': (5.6s)
    √ checking DESCRIPTION meta-information ...
  • excluding invalid files
    Subdirectory 'R' contains invalid file names:
    'README.md'
    Subdirectory 'man' contains invalid file names:
    'README.md'
  • checking for LF line-endings in source and make files and shell scripts
  • checking for empty or unneeded directories
  • building 'GREENGridData_1.0.tar.gz'

Installing package into ‘C:/Users/ParkerR/Anaconda3/envs/r/Rpackages’
(as ‘lib’ is unspecified)
'\aklfs02pi\home1$\ParkerR\Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.

  • installing source package 'GREENGridData' ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    Warning in read.table(...) :
    incomplete final line found by readTableHeader on 'C:\Users\ParkerR\Anaconda3\envs\r\Rpackages\00LOCK-GREENGridData\00new\GREENGridData/data/circuitsToSum_v1.0.csv'
    Warning in read.table(...) :
    incomplete final line found by readTableHeader on 'C:\Users\ParkerR\Anaconda3\envs\r\Rpackages\00LOCK-GREENGridData\00new\GREENGridData/data/circuitsToSum_v1.0.csv'
    Warning in read.table(...) :
    incomplete final line found by readTableHeader on 'C:\Users\ParkerR\Anaconda3\envs\r\Rpackages\00LOCK-GREENGridData\00new\GREENGridData/data/circuitsToSum_v1.1.csv'
    Warning in read.table(...) :
    incomplete final line found by readTableHeader on 'C:\Users\ParkerR\Anaconda3\envs\r\Rpackages\00LOCK-GREENGridData\00new\GREENGridData/data/circuitsToSum_v1.1.csv'
    Warning in read.table(...) :
    invalid input found on input connection 'C:\Users\ParkerR\Anaconda3\envs\r\Rpackages\00LOCK-GREENGridData\00new\GREENGridData/data/dstNZDates.csv'
    Error in read.table(...) : no lines available in input
    ERROR: lazydata failed for package 'GREENGridData'
  • removing 'C:/Users/ParkerR/Anaconda3/envs/r/Rpackages/GREENGridData'
    Error: Failed to install 'GREENGridData' from GitHub:
    (converted from warning) installation of package ‘C:/Users/ParkerR/AppData/Local/Temp/RtmpSeTpqr/file53404cd9fd0/GREENGridData_1.0.tar.gz’ had non-zero exit status

Notably I cannot get read.table() to open these data files even when pointing straight to them (not as part of the installation process)

read.table("C:\Users\ParkerR\GREENGridData\data\dstNZDates.csv")
Error: '\U' used without hex digits in character string starting ""C:\U"

read.table("C:/Users/ParkerR/GREENGridData/data/dstNZDates.csv")
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
line 1 did not have 3 elements

I've not seen this (but then I've not installed on windows). I will try to replicate on a windows virtual machine. Can you open those files using e.g. excel?

yep, can confirm I see this issue on Windows 10

In my case I suspect is a permissions issue in C:\apps\Rlibraries\00LOCK-GREENGridData\00new\GREENGridData/data/circuitsToSum_v1.0.csv which is where it is trying to install it. I guess we could move that data out of /data and put it somehere else since R seems to think data in /data are 'special' ?

Legend, thanks Ben. If it gets too hard I can just run the scripts I need from their source files in that case. Would be nice to have Windows support over the long term though I suppose.

@RaffertyP try now. Worked for me. Dunno why lol

thus demonstrating the power and value of here::here() and setting paths to folders ONCE in .Rprofile (or wherever)

It worked! Cheers 👍