Testing R kernel


In [1]:
.libPaths(c(file.path(Sys.getenv("SPARK_HOME"), "R", "lib"), .libPaths()))

In [2]:
.libPaths()


Out[2]:
  1. '/opt/spark-1.5.2-bin-hadoop2.6/R/lib'
  2. '/usr/local/lib/R/site-library'
  3. '/usr/lib/R/site-library'
  4. '/usr/lib/R/library'

In [3]:
Sys.getenv("SPARK_HOME")


Out[3]:
'/opt/spark'

In [4]:
library(SparkR)
sc <- sparkR.init(master="local")


Attaching package: ‘SparkR’

The following objects are masked from ‘package:stats’:

    filter, na.omit

The following objects are masked from ‘package:base’:

    intersect, rbind, sample, subset, summary, table, transform

Launching java with spark-submit command /opt/spark/bin/spark-submit   sparkr-shell /tmp/RtmpEUjT9Z/backend_port6c95804d8d5 

In [5]:
installed.packages()


Out[5]:
PackageLibPathVersionPriorityDependsImportsLinkingToSuggestsEnhancesLicenseLicense_is_FOSSLicense_restricts_useOS_typeMD5sumNeedsCompilationBuilt
SparkRSparkR /opt/spark-1.5.2-bin-hadoop2.6/R/lib1.5.2 NA R (>= 3.0), methods, methods NA testthat NA Apache License (== 2.0) NA NA NA NA NA 3.2.1
base64encbase64enc /usr/local/lib/R/site-library0.1-3 NA R (>= 2.9.0) NA NA NA png GPL-2 | GPL-3 NA NA NA NA yes 3.2.3
digestdigest /usr/local/lib/R/site-library0.6.8 NA R (>= 2.4.1) NA NA NA NA GPL-2 NA NA NA NA yes 3.2.3
evaluateevaluate /usr/local/lib/R/site-library0.8 NA R (>= 3.0.2) methods, stringr (>= 0.6.2) NA testthat, lattice, ggplot2 NA MIT + file LICENSE NA NA NA NA no 3.2.3
IRdisplayIRdisplay /usr/local/lib/R/site-library0.3 NA R (>= 3.0.1) repr, base64enc NA NA NA MIT + file LICENSE NA NA NA NA no 3.2.3
IRkernelIRkernel /usr/local/lib/R/site-library 0.5 NA R (>= 3.0.1) repr, methods, evaluate (>= 0.5.4), IRdisplay, rzmq (>= 0.7.0), jsonlite (>= 0.9.6), uuid, digestNA NA NA MIT + file LICENSE NA NA NA NA no 3.2.3
jsonlitejsonlite /usr/local/lib/R/site-library 0.9.19 NA methods NA NA curl (>= 0.5), plyr, testthat, knitr, rmarkdown, R.rspNA MIT + file LICENSE NA NA NA NA yes 3.2.3
magrittrmagrittr /usr/local/lib/R/site-library1.5 NA NA NA NA testthat, knitr NA MIT + file LICENSE NA NA NA NA no 3.2.3
reprrepr /usr/local/lib/R/site-library0.4 NA R (>= 3.0.1) NA NA highr NA GPL-3 NA NA NA NA no 3.2.3
rzmqrzmq /usr/local/lib/R/site-library0.7.7 NA NA NA NA NA NA GPL-3 NA NA NA NA yes 3.2.3
stringistringi /usr/local/lib/R/site-library1.0-1 NA R (>= 2.13.1) tools, utils, stats NA NA NA file LICENSE yes NA NA NA yes 3.2.3
stringrstringr /usr/local/lib/R/site-library1.0.0 NA R (>= 2.14) stringi (>= 0.4.1), magrittr NA testthat, knitr NA GPL-2 NA NA NA NA no 3.2.3
uuiduuid /usr/local/lib/R/site-library0.1-2 NA R (>= 2.9.0) NA NA NA NA MIT + file LICENSE NA NA NA NA yes 3.2.3
basebase /usr/lib/R/library3.2.3 base NA NA NA methods NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
bootboot /usr/lib/R/library 1.3-17 recommended R (>= 3.0.0), graphics, statsNA NA MASS, survival NA Unlimited NA NA NA NA no 3.2.1
classclass /usr/lib/R/library 7.3-14 recommended R (>= 3.0.0), stats, utilsMASS NA NA NA GPL-2 | GPL-3 NA NA NA NA yes 3.2.2
clustercluster /usr/lib/R/library 2.0.3 recommended R (>= 2.15.0), utils graphics, grDevices, statsNA MASS NA GPL (>= 2) NA NA NA NA yes 3.2.1
codetoolscodetools /usr/lib/R/library0.2-14 recommended R (>= 2.1) NA NA NA NA GPL NA NA NA NA no 3.2.2
compilercompiler /usr/lib/R/library3.2.3 base NA NA NA NA NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
datasetsdatasets /usr/lib/R/library3.2.3 base NA NA NA NA NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
foreignforeign /usr/lib/R/library 0.8-66 recommended R (>= 3.0.0) methods, utils, statsNA NA NA GPL (>= 2) NA NA NA NA yes 3.2.2
graphicsgraphics /usr/lib/R/library3.2.3 base NA grDevices NA NA NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
grDevicesgrDevices /usr/lib/R/library3.2.3 base NA NA NA KernSmooth NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
gridgrid /usr/lib/R/library3.2.3 base NA grDevices NA lattice NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
KernSmoothKernSmooth /usr/lib/R/library 2.23-15 recommended R (>= 2.5.0), statsNA NA MASS NA Unlimited NA NA NA NA yes 3.2.1
latticelattice /usr/lib/R/library 0.20-33 recommended R (>= 3.0.0) grid, grDevices, graphics, stats, utilsNA KernSmooth, MASS chron GPL (>= 2) NA NA NA NA yes 3.2.1
MASSMASS /usr/lib/R/library 7.3-44 recommended R (>= 3.1.0), grDevices, graphics, stats, utilsmethods NA lattice, nlme, nnet, survival NA GPL-2 | GPL-3 NA NA NA NA yes 3.2.2
MatrixMatrix /usr/lib/R/library 1.2-3 recommended R (>= 3.0.1) methods, graphics, grid, stats, utils, latticeNA expm, MASS MatrixModels, graph, SparseM, sfsmisc GPL (>= 2) NA NA NA NA yes 3.2.2
methodsmethods /usr/lib/R/library3.2.3 base NA utils NA codetools NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
mgcvmgcv /usr/lib/R/library 1.8-7 recommended R (>= 2.14.0), nlme (>= 3.1-64) methods, stats, graphics, Matrix NA splines, parallel, survival, MASSNA GPL (>= 2) NA NA NA NA yes 3.2.1
nlmenlme /usr/lib/R/library 3.1-122 recommended graphics, stats, R (>= 3.0.0)lattice NA Hmisc, MASS NA GPL (>= 2) NA NA NA NA yes 3.2.2
nnetnnet /usr/lib/R/library 7.3-11 recommended R (>= 2.14.0), stats, utilsNA NA MASS NA GPL-2 | GPL-3 NA NA NA NA yes 3.2.2
parallelparallel /usr/lib/R/library3.2.3 base NA tools NA methods snow, nws, Rmpi Part of R 3.2.3 NA NA NA NA NA 3.2.3
rpartrpart /usr/lib/R/library 4.1-10 recommended R (>= 2.15.0), graphics, stats, grDevicesNA NA survival NA GPL-2 | GPL-3 NA NA NA NA yes 3.2.1
spatialspatial /usr/lib/R/library 7.3-10 recommended R (>= 3.0.0), graphics, stats, utilsNA NA MASS NA GPL-2 | GPL-3 NA NA NA NA yes 3.2.2
splinessplines /usr/lib/R/library3.2.3 base NA graphics, stats NA Matrix, methods NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
statsstats /usr/lib/R/library 3.2.3 base NA NA NA MASS, Matrix, SuppDists, methods, stats4NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
stats4stats4 /usr/lib/R/library 3.2.3 base NA graphics, methods, statsNA NA NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
survivalsurvival /usr/lib/R/library 2.38-3 recommended R (>= 2.13.0), graphics, statssplines, methods NA cmprsk NA LGPL (>= 2) NA NA NA NA yes 3.2.1
tcltktcltk /usr/lib/R/library3.2.3 base NA utils NA NA NA Part of R 3.2.3 NA NA NA NA NA 3.2.3
toolstools /usr/lib/R/library 3.2.3 base NA NA NA XML, codetools, methodsNA Part of R 3.2.3 NA NA NA NA NA 3.2.3
utilsutils /usr/lib/R/library3.2.3 base NA NA NA methods NA Part of R 3.2.3 NA NA NA NA NA 3.2.3

In [6]:
library("stats")

In [7]:
x <- mean(2:50)

In [8]:
x


Out[8]:
26

In [ ]: