0

I'm having a problem getting littler to see an installed packaged. I've gotten it down to just trying to fun this one line saved in a file called min.R

require(jsonlite)

I can execute this line of code and load the package just fine running the R terminal, but if I try this from the command line I get an error that jsonlite is not found:

root# r min.R
Loading required package: jsonlite
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘jsonlite’

Why is this happening and how can I fix it?

Additional details:

If I try require(zoo) this works fine when run from littler. Here is some of the output of installed.packages() in relevant part:

           Enhances
jsonlite   NA
...
zoo        NA

           License                       License_is_FOSS License_restricts_use
jsonlite   "MIT + file LICENSE"          NA              NA
...
zoo        "GPL-2 | GPL-3"               NA              NA
           OS_type MD5sum NeedsCompilation Built
jsonlite   NA      NA     "yes"            "3.0.2"
...
zoo        NA      NA     "yes"            "3.0.2" 
MrFlick
  • 195,160
  • 17
  • 277
  • 295
sunny
  • 3,853
  • 5
  • 32
  • 62
  • Off topic, there was nothing wrong with your Meta question a minute ago about Meetups, I don't know who the idiots were who downvoted it. There's e.g. http://www.meetup.com/de/Stack-Overflow-Meetups/ and [this massive 2012 event](https://blog.stackexchange.com/2012/03/stack-overflow-meetup-everywhere-april-28-2012/). If you undelete it I'd be happy to write an answer. – Pekka Aug 28 '15 at 18:01
  • @Pekka웃 I'd be happy to undelete if you want to write an answer, but I can't refind the page. Have you still got the link? – sunny Aug 28 '15 at 18:06
  • Yup! http://meta.stackoverflow.com/questions/303709/in-person-meetups – Pekka Aug 28 '15 at 18:06
  • Was jsonlite stored in the same place as your other packages? – Dason Sep 02 '15 at 19:36
  • @Dason thanks for fixing the formatting. – sunny Sep 02 '15 at 19:47

2 Answers2

1

Sorry, I missed this when it was originally posted.

In the past littler read nothing. I then added /etc/littler.r and ~/.littler.r support. The next version will read /etc/R/Rprofile.site and ~/.Rprofile as well.

So for now just put some code into ~/.littler.r. As for not finding things, check via

$ r -e 'print(.libPaths())'
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
0

I never found an answer but this issue was not reproduced using RJSONIO so I switched to that package. I did try reinstalling littler, R, and jsonlite but the problem remained.

sunny
  • 3,853
  • 5
  • 32
  • 62