小编sma*_*ski的帖子

TwitteR r包:/usr/lib/x86_64-linux-gnu/libcurl.so.4:找不到版本`CURL_OPENSSL_3'

我最近将我的操作系统更新到Ubuntu 18.04并且twitteR R软件包不能再使用了.

我在期间收到以下错误消息setup_twitter_oauth.

> setup_twitter_oauth(api_key,api_secret)
[1] "Using browser based authentication"
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/my-laptop/R/x86_64-pc-linux-gnu-library/3.4/curl/libs/curl.so':
  /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /home/my-laptop/R/x86_64-pc-linux-gnu-library/3.4/curl/libs/curl.so)
Run Code Online (Sandbox Code Playgroud)

我试图安装libcurl3.但是安装过程想要删除我的r安装以及libcurl4.这就是我得到的,

my-laptop:~$ sudo apt-get install libcurl3
[sudo] password for my-laptop: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cdbs dh-translations fonts-mathjax intltool jq libblas-dev libc-ares2
  libhttp-parser2.7.1 libjq1 …
Run Code Online (Sandbox Code Playgroud)

r libcurl twitter-oauth ubuntu-18.04

6
推荐指数
2
解决办法
3351
查看次数

无法在Windows 7中安装R包

我试图从这个链接安装一个名为ei的软件包.通过安装GCC,r-base-dev和其他一些R包依赖项,它在我的Ubuntu Linux系统中运行良好.

现在我尝试在Windows 7环境中安装相同的内容.到目前为止,我的设置如下,

  1. R安装在主文件夹中(c:\ Users\username\R-2.12.1\R.它设置为以管理员身份运行,R文件夹是可写的.
  2. 我的工作目录是(c:\ Users\username\Documents)
  3. Rtool安装在(c:\ Rtools)中

有了这个设置,

  1. 我尝试通过命令install.packages("ei",repos ="http://r.iq.harvard.edu")安装它.此命令给我以下错误消息.

将软件包安装到'C:\ Users\username\Documents/R/win-library/2.12'中(因为'lib'未指定)警告消息:在getDependencies(pkgs,dependencies,available,lib)中:package'ei '不可用

之后我决定尝试从本地zip文件安装它,所以我按照以下方式进行,

  1. 我已经下载了包ei_0.938.tar.gz,解压缩并从中创建一个zip文件.我把它放在我的工作目录中.
  2. 我打开终端(Run> cmd),转到工作目录并尝试运行命令R COM INSTALL ei

它显示以下错误消息,

C:\ Users\username\Documents> R COM INSTALL ei'R'不被识别为内部或外部命令,可操作程序或批处理文件.

我不知道现在该怎么办.有人帮忙吗?

注意:我可以从CRAN repos安装软件包.

_ RB

r

4
推荐指数
1
解决办法
6181
查看次数

Sorting one variable in a data frame by id

I have a data frame with lot of company information separated by an id variable. I want to sort one of the variables and repeat it for every id. Let's take this example,

df <- structure(list(id = c(110, 110, 110, 90, 90, 90, 90, 252, 252
), var1 = c(26, 21, 54, 10, 18, 9, 16, 54, 39), var2 = c(234, 
12, 43, 32, 21, 19, 16, 34, 44)), .Names = c("id", "var1", "var2"
), row.names = c(NA, -9L), class …
Run Code Online (Sandbox Code Playgroud)

sorting grouping r

4
推荐指数
2
解决办法
111
查看次数

Rfast 安装:/usr/lib/R/etc/Makeconf:168:目标“Norm.o”的配方失败

我正在尝试安装 Rfast 包。它给了我以下错误,

/usr/lib/R/etc/Makeconf:168: recipe for target 'Norm.o' failed
    make: *** [Norm.o] Error 1
Run Code Online (Sandbox Code Playgroud)

完整的错误信息是这样的,

> install.packages("Rfast", dependencies = TRUE)

* installing *source* package 'Rfast' ...
** package 'Rfast' successfully unpacked and MD5 sums checked
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG  -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"   -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Diag.cpp -o Diag.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG  -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include"   -fopenmp -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Norm.cpp -o Norm.o
In …
Run Code Online (Sandbox Code Playgroud)

r rcpp rcpp11

3
推荐指数
1
解决办法
1430
查看次数

通过从另一个变量中取值来随机替换值

我想从另一个变量中替换一个变量的一些值(比如 10 个中的 3 个值)。选择必须是随机的,并且必须保持相同的 id。

这是一个示例数据,

id <- c(seq(1:10))
a <- c(11, 22, 33, 44, 55, 66, 77, 88, 99, 109)
b <- c(111, 222, 333, 444, 555, 666, 777, 888, 999, 1099)
data <- data.frame(id, a, b)
data

> data
   id   a    b
1   1  11  111
2   2  22  222
3   3  33  333
4   4  44  444
5   5  55  555
6   6  66  666
7   7  77  777
8   8  88  888
9   9  99 …
Run Code Online (Sandbox Code Playgroud)

r dplyr data.table tidyverse

3
推荐指数
1
解决办法
262
查看次数