我以前brew install rstudio-server在Mac OS X 10.11.4 上成功安装了rstudio-server .
现在,我试图登录到rstudio-server 0.99.902但没有成功.从客户端,我得到一个弹出窗口说 -
"RStudio初始化错误","无法连接到服务".
我使用的用户具有用户ID 1100,因此我认为该问题与帐户权限无关.
在运行守护程序时,当我尝试登录时,显示的错误/var/log/system.log是:
rserver [1100]:ERROR系统错误61(连接被拒绝)[request-uri =/rpc/client_init]; 发生在:void rstudio :: core :: http :: LocalStreamAsyncClient :: handleConnect(const boost :: system :: error_code&)/tmp/rstudio-server-20160803-68705-uhvyws/rstudio-0.99.902/src/cpp /core/include/core/http/LocalStreamAsyncClient.hpp:119; LOGGED FROM:void rstudio :: server :: session_proxy ::(匿名命名空间):: logIfNotConnectionTerminated(const rstudio :: core :: Error&,const http :: Request&)/ tmp/rstudio-server-20160803-68705-uhvyws /rstudio-0.99.902/src/cpp/server/ServerSessionProxy.cpp:308
崩溃报告:http://pastebin.com/GYkFZ8fT
在运行时sudo /usr/local/bin/rserver --server-daemonize=0,当我尝试登录时,没有错误输出到控制台,但我确实在浏览器的弹出窗口中出现此错误:Error occurred during transmission.
崩溃报告:http://pastebin.com/kJMsPh6s
附加信息:
rstudio-server verify-installation回报 …
I'm just starting to experiment with the Rcpp package, so please be patient with me.
I read the Rcpp vignettes and I've tried a few given examples in the Rcpp documentation. Now, I thought I'd start by wrapping some functions from the GLFW libray, a library written in C.
So I thought I'd start with the function glfwInit. I wrote this simple cpp source file in a package named pixel to wrap it under the name glfw_init:
#include …Run Code Online (Sandbox Code Playgroud) 在基本矢量类型中,逻辑上没有显示其长度的特殊原因是什么?
View(list(1:10, rep(NA, 10), rep(1.0, 10), rep('x', 10)))
Run Code Online (Sandbox Code Playgroud)
我有两个嵌套列表,其结构与我想要组合的结构相同(在c()某种意义上).
对于这种关系,我可能已经存在一个关于图论或计算机科学中相同结构的概念,但我不知道.
所以这是我试图通过相同的结构澄清我的意思:
所以我想知道是否已经有一个解决这个问题的方法,我认为这可能是相当普遍和常见的...(?)任何解决方案涉及:
rapply;purrr功能组合的Tidyverse解决方案;rlist包中的功能会很好!
foo并且bar是具有相同结构的两个示例列表.
wonderful是由组合foo和bar(手动完成)产生的所需列表.
我希望它足够清楚!
# Input lists: foo and bar
foo <- list(a = list(a1 = 1:3, a2 = rep('a', 3)), b = list(b1 = list(b11 = c(4,5,6), b12 = rep('b', 3)), b2 = list(b21 = list(b31 = c(0, 1, 2)))), c = list(list(c21 = 1:3), list(c21 = 4:6), …Run Code Online (Sandbox Code Playgroud) 我正在编写一个使用 tidyverse 函数的包,即使用非标准评估,dplyr::filter例如:
setMethod("filter_by_id",
signature(x = "studies", id = "character"),
definition = function(x, id) {
study_id <- rlang::expr(study_id)
lst <- purrr::map(s4_to_list(x), ~ dplyr::filter(.x, !!study_id %in% id))
y <- list_to_s4(lst, "studies")
return(y)
})
Run Code Online (Sandbox Code Playgroud)
我正在使用!!运算符(我可能会使用rlang包中的其他几个),我想知道是否需要像使用 pipe-operator%>%一样显式导入它,如以下问题中所述:R: use magrittr pipe operator in自己写的包。
有什么等价于usethis::use_pipe()但对于运营商 from rlang?
在下面的C++源文件中,在函数中glfw_get_monitors如何设置对象每个元素的类属性monitor_ptrs?
该行monitor_ptrs[i].attr("class") = "GLFWmonitor";抛出编译错误:
\xe2\x80\x98Rcpp::Vector<19>::Proxy\xe2\x80\x99 {aka \xe2\x80\x98class Rcpp::internal::generic_proxy<19>\xe2\x80\x99} has no member named \xe2\x80\x98attr\xe2\x80\x99\nRun Code Online (Sandbox Code Playgroud)\n\n#ifndef RCPP_GLFW_TYPES_H\n#define RCPP_GLFW_TYPES_H\n\n#include <Rcpp.h>\n#include <GLFW/glfw3.h>\n\nvoid glfw_destroy_monitor(GLFWmonitor*);\n\n// /sf/ask/2884741681/\n\ntypedef Rcpp::XPtr<GLFWwindow, Rcpp::PreserveStorage, glfwDestroyWindow> GLFWwindow_ptr;\ntypedef Rcpp::XPtr<GLFWmonitor, Rcpp::PreserveStorage, glfw_destroy_monitor> GLFWmonitor_ptr;\n\n\n#endif\n\nRun Code Online (Sandbox Code Playgroud)\n\n#include "glfw_types.h"\nusing namespace Rcpp;\n\n// [[Rcpp::export]]\nGLFWmonitor_ptr glfw_get_primary_monitor() {\n\n GLFWmonitor_ptr new_monitor = GLFWmonitor_ptr(glfwGetPrimaryMonitor(), true);\n\n new_monitor.attr("class") = "GLFWmonitor";\n\n return new_monitor;\n}\n\n// [[Rcpp::export]]\nRcpp::List glfw_get_monitors() {\n\n int nr_monitors;\n GLFWmonitor** monitors = glfwGetMonitors(&nr_monitors);\n Rcpp::List monitor_ptrs(nr_monitors);\n\n for(int i = 0; i < nr_monitors; i++) {\n monitor_ptrs[i] …Run Code Online (Sandbox Code Playgroud) foo <- data.table(x = 1:5/sum(1:5),
y = (-4):0/sum((-4):0),
z1 = 2:6/sum(2:6),
z2 = 2:6/sum(2:6))
Run Code Online (Sandbox Code Playgroud)
假设我有foo数据表(如上所述):
x y z1 z2
1: 0.06666667 0.4 0.10 0.10
2: 0.13333333 0.3 0.15 0.15
3: 0.20000000 0.2 0.20 0.20
4: 0.26666667 0.1 0.25 0.25
5: 0.33333333 0.0 0.30 0.30
Run Code Online (Sandbox Code Playgroud)
如何有效地计算唯一列?在这种情况下只有3.
请假设一般:
foo始终是数据表而不是矩阵; 虽然列总是数字.foo 实际上很大,nrow> 20k,ncol> 100是否可以在不制作额外数据副本的情况下执行此操作?
我目前的方法是使用apply列paste来获取每列的单个值,然后length(unique(.))对结果执行...
是否有任何魔法data.table::transpose(),data.table::uniqueN也许还有其他朋友?
为了清楚起见,我正在寻找一种简单的方法来添加 90 度旋转的直方图或密度图,其 x 轴与下面给出的示例图的 y 轴对齐。
library(ggplot2)
library(tibble)
x <- seq(100)
y <- rnorm(100)
my_data <- tibble(x = x, y = y)
ggplot(data = my_data, mapping = aes(x = x, y = y)) +
geom_line()
Run Code Online (Sandbox Code Playgroud)

由reprex 包(v0.2.1)于 2019-01-28 创建
例如,在尝试将R软件包安装curl为的依赖项时usethis:
* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF …Run Code Online (Sandbox Code Playgroud) 来自 R 背景,刚开始学习 Julia,我想知道 Julia 中的文档如何,以及是否有类似于 R 的帮助页面和小插图。
此外,在 R 中,可以使用 roxygen 注释块记录函数,Julia 中是否也有类似的东西?
我想这可能是一个相当简单的问题,但如何做到这一点(基础 R):
df <- data.frame(x=10:1,y=(1:10)^2)
df[match(c(3,5,7), df$x),]
Run Code Online (Sandbox Code Playgroud)
用惯用的 dplyr 说法:
tb <- dplyr::as.tbl(df)
dplyr::filter(tb, ??? )
Run Code Online (Sandbox Code Playgroud)
或者,换句话说,应该怎样做???才能使它在功能上等同于第一个片段?请注意,结果数据帧/tibble 中的行顺序是相关的。