Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in FUN(X[[i]], ...) : subscript out of bounds #135

Closed
csgillespie opened this issue Sep 16, 2018 · 5 comments
Closed

Error in FUN(X[[i]], ...) : subscript out of bounds #135

csgillespie opened this issue Sep 16, 2018 · 5 comments

Comments

@csgillespie
Copy link

I've launched R in a directory with an empty .Rprofile and an .Renviron with the single line

R_LIBS=/data/ncsg3/Rpackages/

Launching R, I then get

ncsg3@jetset:/tmp$ R
> library(fs)
> dir_ls()
Error in FUN(X[[i]], ...) : subscript out of bounds

If I make the .Renviron empty, then everything works

ncsg3@jetset:/tmp$ R
> library(fs, lib.loc = "/data/ncsg3/Rpackages/")
> dir_ls()
RtmpJjQpb6
Rtmpqi3AjG

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] fs_1.2.6

loaded via a namespace (and not attached):
[1] compiler_3.5.1 Rcpp_0.12.18  
@jimhester
Copy link
Member

Could you provide the traceback for the error?

@csgillespie
Copy link
Author

Different computer, but similar set-up in terms of OS.

> traceback()
7: vapply(nms, `[[`, character(1), 1)
6: setNames(vapply(nms, `[[`, character(1), 2), vapply(nms, `[[`, 
       character(1), 1))
5: colourise_fs_path(x, ...)
4: multicol(colourise_fs_path(x, ...))
3: cat(multicol(colourise_fs_path(x, ...)), sep = "")
2: print.fs_path(x)
1: function (x, ...) 
   UseMethod("print")(x)

Interestingly, this works

R> fs::dir_ls() %>% paste()
[1] "tmp1" "tmp2"
R> fs::dir_ls()
Error in FUN(X[[i]], ...) : subscript out of bounds

@jimhester
Copy link
Member

Something seems wrong in how your LS_COLORS environment variable is defined, could you give the value of that?

@csgillespie
Copy link
Author

R> Sys.getenv("LS_COLORS")
[1] ":di=1;38;5;39:ex=1;38;5;34:ln=1;38;5;45:*.py=1;38;5;220:*.pdf=1;38;5;202:*.tex=1;38;5;196"

@jimhester
Copy link
Member

If you remove the leading : it should work.

jimhester added a commit that referenced this issue Sep 17, 2018
We could try to patch up the empty case as shown in the issue, but I
think it is better to just bail and give up coloring if something seems
wrong. I decided not to issue a warning for this case, if it comes up
again we can think about adding one.

Fixes #135
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants