Questions tagged [littler]

Use this tag when asking questions about running R scripts specifically via the littler command

littler provides the R program, a simplified command-line interface for GNU R. This allows direct execution of commands, use in piping where the output of one program supplies the input of the next, as well as adding the ability for writing hash-bang scripts, i.e. creating executable files starting with, say, #!/usr/bin/r. (from http://dirk.eddelbuettel.com/code/littler.html)

littler is an alternative to the Rscript command for running R scripts from the command line.

17 questions
40
votes
1 answer

Difference between Rscript and littler

...besides the fact that Rscript is invoked with #!/usr/bin/env Rscript and littler with #!/usr/local/bin/r (on my system) in first line of script file. I've found certain differences in execution speed (seems like littler is a bit slower). I've…
aL3xa
  • 35,415
  • 18
  • 79
  • 112
2
votes
0 answers

Detecting how an R file is being run

R code can get run in various ways, such as being called via source, loaded from a package, or read in from stdin. I'd like to detect this in order to create files that can work in a multitude of contexts. Current experimental detector script is…
Spacedman
  • 92,590
  • 12
  • 140
  • 224
2
votes
0 answers

How to use R littler with docker to install installable source files?

I would like to install some specific version of a R package. According to the documentation littler recognise installable source files. So I assumed that may work: FROM r-base:latest RUN apt-get update \ && install.r --error…
Jacky
  • 159
  • 7
2
votes
2 answers

checkCompilerOptions Error while installing package (littler/Docker)

On its last line, this Docker file calls littler::install.r to install Rcpp RcppEigen and matrixStats. The whole code was working like a charm a couple of months back. Now, it bombs at that last step. More precisely, Rcpp and RcppEigen still…
user189035
  • 5,589
  • 13
  • 52
  • 112
2
votes
2 answers

littler determine if running as deployed

I am pretty excited to have found Jeff and Dirk's application littler to run R functions from terminal. ¡kudos! Since then, I have been able to pass my functions to my development team and have them running in other servers. My question is about…
Diego-MX
  • 2,279
  • 2
  • 20
  • 35
1
vote
0 answers

the problem of getSrcFilename() in R but not in littler

I'd expect getSrcFilename() also works in R not just lr. Is it a bug in the command R? $ lr -e "source('main.R');" [1] "main.R" $ R --slave --no-save --no-restore --no-init-file -e "source('main.R')" character(0) $ cat main.R…
user1424739
  • 11,937
  • 17
  • 63
  • 152
1
vote
4 answers

Installing R packages with bash script - responding to prompts

At my job, the edge node server that accesses our cluster is re-instantiated every day. This means I have to clone our repo and install a bunch of R packages every morning. I wrote a bash script (using https://github.com/eddelbuettel/littler to open…
data princess
  • 1,130
  • 1
  • 23
  • 42
1
vote
1 answer

Third littler example/littler script --how do you run it?

So, I'm trying to reproduce the example here So the first three examples: echo 'cat(pi^2,"\n")' | r and r -e 'cat(pi^2, "\n")' and ls -l /boot | awk '!/^total/ {print $5}' | \ r -e 'fsizes <- as.integer(readLines()); …
user189035
  • 5,589
  • 13
  • 52
  • 112
1
vote
1 answer

Why I can't load most libraries in littler?

I have a simple script foo.R, and inside it a single line: library("argparse") When I invoke the script from the bash shell I got the following error: $r foo.R Error in library("argparse") : there is no package called ‘argparse’ OTOH, when I…
Adam Ryczkowski
  • 7,592
  • 13
  • 42
  • 68
0
votes
0 answers

run R session as daemon and allow concurrent access

I have series of R scripts and I want to run them when some reqeusts are received. I want to speedup the running time beacuse most of them are plot script and they load packages are time consuming. I read the links mentioned below and have some…
0
votes
1 answer

how to install from bioconductor using install2.r from littler?

I'm trying to use https://cran.r-project.org/web/packages/littler/vignettes/littler-examples.html#install2r:_With_Cmdline_Parsing to install some packages during which I get the error dependency 'graph' is not available. It appears that this package…
Vijay
  • 151
  • 1
  • 11
0
votes
1 answer

How to call littler without sourcing ~/.Rprofile?

It seems that when I call littler from the command line, it will source ~/.Rprofile. Is there a way to prevent it from sourcing ~/.Rprofile?
user1424739
  • 11,937
  • 17
  • 63
  • 152
0
votes
1 answer

How to have a ggplot/plotly plot open in a browser from a shell script

I would like to make an R bash script that makes a ggplot/plotly plot when it runs I have the following script which runs in interactive mode using littler. #!/usr/bin/env r library(plotly) set.seed(955) # Make some noisily increasing data dat <-…
Alex
  • 2,603
  • 4
  • 40
  • 73
0
votes
1 answer

R: compilation failed for package ‘littler’

When I running R in the container and trying to install a R package littler, there gives some errors: /usr/bin/ld: cannot find -lpcre /usr/bin/ld: cannot find -llzma /usr/bin/ld: cannot find -lbz2 collect2: error: ld returned 1 exit…
gabby
  • 1
0
votes
2 answers

littler doesn't see installed package

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…
sunny
  • 3,853
  • 5
  • 32
  • 62
1
2