我正在尝试将其安装在Android操作系统上(我有一台三星Galaxy平板电脑)。我想安装R和RStudio。
我已经上网试图了解这一点,但大部分文章都很陈旧(可追溯到2013年)并且对我没有多大意义。
我的个人笔记本电脑(带有Windows操作系统)上安装了R和R工作室,发现这些设置非常简单,但在平板电脑上找出如何做到这一点时遇到了一些麻烦。
如果有人最近这样做并成功了,请告诉我。
答案 0 :(得分:9)
更新软件包存储库(两次!):
apt-get update apt-get update
阻止系统Perl的更新:
apt-mark hold perl-base
安装R:
apt-get install r-base
从Debian存储库安装所有可用的cran包:
apt-get install r-cran *
从命令行启动R:
[R
答案 1 :(得分:2)
Rstudio服务器无法在非root设备上运行,该设备安装在termux的ubuntu中。相关链接:rstudio in android - rooted,non-root rstudio discussion。
我在无根设备中找到了两种解决方法。在浏览器或VNC Viewer上工作。
(已在使用Android 7.1的Yoga Book和具有Android 8的Huawei手机中进行了测试-尺寸为ggplot 1.66 Gb)
apt update && apt upgrade
apt-get install apt-transport-https software-properties-common
# add R repository
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu disco-cran35/'
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
apt update && apt upgrade
apt install nodejs
apt install npm # absence of this causes non-editable cells in jupyter
apt install gfortran
apt install liblapack-dev
apt install libopenblas-dev
# install R
apt install r-base-dev # or r-base or r-base-core
# install python package manager
apt-get install python3-pip
# install jupyter
pip3 install jupyterlab
# open R
R
# Package necessary for jupyter
install.packages("IRkernel")
IRkernel::installspec()
q()
jupyter lab --allow-root
# as you will see you have to paste something like this in your internet browser
http://127.0.0.1:8889/?token=1a0f9b3d472d155bb4d46df119b937646d6192f569c9d635
注意:在termux应用程序(谷歌播放)中可以安装R,请参见Conor link;重要的setupclang-gfort-8
步骤可以在安装make
和gcc-8
并在(过时的)Conor协议的输出中使用新的程序包名称之后完成。如果需要GUI,则会出现问题。一个选项是Rcmdr
软件包,但是由于termux还没有tcl-tk,如您在capabilities()
中在R中看到的那样,我结束了在termux中安装ubuntu
aterm
#in R:
install.packages("Rcmdr")
vnc4server
tigervncserver -xstartup aterm
在VNC Viewer中,连接到127.0.0.1:5901
显示屏所对应的:1
(以白色显示aterm
),在R
中打开aterm
,然后是library(Rcmdr)
。
绘图后,请参见ggplot示例,我不得不(盲目地)编写dev.off()
,因为没有其他方法可以返回到脚本窗口。
require(ggplot2)
ggplot(diamonds) + geom_point(aes(x=carat, y=price, color=cut)) + geom_smooth(aes(x=carat, y=price, color=cut))
注意:我也在ubuntu中安装了X11,但似乎并没有改善Rcmdr
的GUI体验。在带有android的瑜伽书中,@ Ajay答案无效。
答案 2 :(得分:0)
不完全是R Studio,但仍然很酷……请遵循Installing R on Android via Termux中的Conor Anderson's blog指南。
一次输入以下命令:
pkg install curl gnupg
mkdir -p "$PREFIX/etc/apt/sources.list.d/"
echo "deb https://its-pointless.github.io/files/ termux extras" > "$PREFIX/etc/apt/sources.list.d/pointless.list"
curl "https://its-pointless.github.io/pointless.gpg" | apt-key add
安装以下软件包。最好单独安装每个软件包以监视警告,我认为此时某些软件包可能已被弃用。
pkg install r-base \
make \
clang \
gcc-7 \
libgfortran \
openssl-dev \
libcurl-dev \
libicu-dev \
libxml2-dev
setupclang-gfort-8
R