R库和路径-概述 [英] R libraries and paths - overview

查看:121
本文介绍了R库和路径-概述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将R Studio与R版本3.1一起使用. 我对整体文件路径和约定的工作方式感到困惑. 如果有人链接到一个很好的解释,那将是很好的.

I am using R Studio with R version 3.1. I am a bit confused about how the overall file paths and conventions work. If someone has a link to a good explanation that would be great.

我想知道是否需要将软件包安装到工作目录中,即我是否需要将lib ="/xx/yy/zz"设置为与getwd()返回相同的位置?

I want to know if a package needs to be installed into the working directory ie do i need to set lib = "/xx/yy/zz" to the same place as the getwd() returns ?

我应该已经成功安装了RWeka ---成功打包了"RWeka"软件包并检查了MD5的总和 但是,当我尝试"library("RWeka")时,我得到了

I have supposedly succesfully installed RWeka --- package ‘RWeka’ successfully unpacked and MD5 sums checked however when I try "library("RWeka") i get the

"Error in library("Rweka") : there is no package called ‘Rweka’   "

安装软件包后,它会显示

After I had installed the package it said

"package ‘RWeka’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
    Installing package into ‘C:/Users/MY NAME/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)

因此,问题-所有软件包都下载到R的安装位置了吗,只要我们尝试访问的所有代码和文件都在设置的工作导向器中就可以了.

hence the question - are all packages downloaded to the place where R is installed and thats ok as long as all the code and files we are trying to access are in the set working director.

非常感谢

这是火车 RWeka安装成功 但是库(RWeka)显示以下内容

Here is the train RWeka installed successfully however library(RWeka) shows the following

install.packages("RWeka") 将软件包安装到"C:/用户/我的名字/文档/R/win-library/3.1" (因为未指定"lib") 尝试使用URL' http://cran.rstudio.com/bin/windows/contrib/3.1/RWeka_0.4-23.zip ' 内容类型应用程序/邮政编码"长度535623字节(523 Kb) 打开的URL 下载523 Kb

install.packages("RWeka") Installing package into ‘C:/Users/My Name/Documents/R/win-library/3.1’ (as ‘lib’ is unspecified) trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/RWeka_0.4-23.zip' Content type 'application/zip' length 535623 bytes (523 Kb) opened URL downloaded 523 Kb

"RWeka"包装已成功打开包装,并检查了MD5金额

package ‘RWeka’ successfully unpacked and MD5 sums checked

下载的二进制软件包在 C:\ Users \ My Name \ AppData \ Local \ Temp \ RtmpOc8SpX \ downloaded_pa​​ckages

The downloaded binary packages are in C:\Users\My Name\AppData\Local\Temp\RtmpOc8SpX\downloaded_packages

图书馆(RWeka) 错误:.onLoad在'rJava'的loadNamespace()中失败,详细信息: 致电:fun(libname,pkgname) 错误:软件/JavaSoft注册表中没有CurrentVersion条目!尝试重新安装Java,并确保R和Java具有匹配的体系结构. 错误:"RWeka"的包或名称空间加载失败

library(RWeka) Error : .onLoad failed in loadNamespace() for 'rJava', details: call: fun(libname, pkgname) error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures. Error: package or namespace load failed for ‘RWeka’

所以我想问题是 1.除了从Java.com安装Java外,还需要执行其他操作(已卸载并重新安装,没有任何变化) 2.我正在使用R 3.1.1

So I guess the questions are 1. Something else to do other than installing Java from Java.com (have uninstalled and reinstalled no change) 2. I am using R 3.1.1

推荐答案

Andy/Prakash是正确的-R中的函数

Andy / Prakash are correct - the function in R

Sys.getenv("R_ARCH")会告诉您运行的是R的32位还是64位版本

Sys.getenv("R_ARCH") will tell you whether you are running the 32 bit or 64 bit version of R

64位Java可以在这里下载.

64 bit java can be downloaded here.

https://www.java. com/en/download/faq/java_win64bit.xml#Java%20for%2064-bit

这篇关于R库和路径-概述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆