我最近将我的操作系统更新到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) 我试图从这个链接安装一个名为ei的软件包.通过安装GCC,r-base-dev和其他一些R包依赖项,它在我的Ubuntu Linux系统中运行良好.
现在我尝试在Windows 7环境中安装相同的内容.到目前为止,我的设置如下,
有了这个设置,
将软件包安装到'C:\ Users\username\Documents/R/win-library/2.12'中(因为'lib'未指定)警告消息:在getDependencies(pkgs,dependencies,available,lib)中:package'ei '不可用
之后我决定尝试从本地zip文件安装它,所以我按照以下方式进行,
它显示以下错误消息,
C:\ Users\username\Documents> R COM INSTALL ei'R'不被识别为内部或外部命令,可操作程序或批处理文件.
我不知道现在该怎么办.有人帮忙吗?
注意:我可以从CRAN repos安装软件包.
_ RB
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) 我正在尝试安装 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) 我想从另一个变量中替换一个变量的一些值(比如 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 ×5
data.table ×1
dplyr ×1
grouping ×1
libcurl ×1
rcpp ×1
rcpp11 ×1
sorting ×1
tidyverse ×1
ubuntu-18.04 ×1