Automatic caret parameter tuning fails in glmnet

Context and error message I try to fit a two-class prediction model using glmnet within caret. I incur an error when using the caret default tune grids. I don't think it is due to wrongly formatted data because, when specifying my own tuning grid, there is no problem. The error message is: Error in loop$lambda[loop$alpha == alph[i]] <- np[which.max(np)] : replacement has length zero

glmnet中的自动脱字符参数调整失败

上下文和错误消息 我尝试使用glmnet在插入符号中拟合一个两级预测模型。 使用插入符号默认调节网格时会发生错误。 我不认为这是由于格式错误的数据造成的,因为在指定我自己的调谐网格时,没有问题。 错误消息是: Error in loop$lambda[loop$alpha == alph[i]] <- np[which.max(np)] : replacement has length zero 在检查发生错误的行时,可以看到R尝试在NA的向量np (由caret / glmnet选择的lambda值?)上找到最

downloadButton/ downloadHandler does not recognize filename argument

I've run into a problem with downloadHandler() in Shiny: If I want to download any file via this function, the filename in the download window is the same as the name of the output-variable (in the example: "downloadData"), but not as it is declared in "filename=" in downloadHandler() (which should be "data-2017-02-13.csv"). Note that the following example is

downloadButton / downloadHandler不识别文件名参数

在Shiny中遇到downloadHandler()问题: 如果我想通过此函数下载任何文件,则下载窗口中的文件名与输出变量的名称相同(例如:“downloadData”),但不是在“filename =”中声明的文件名downloadHandler()(应该是“data-2017-02-13.csv”)。 请注意,下面的示例来自downloadHandler() - 帮助页面,所以我猜想R或RStudio在编写R脚本时存在一般性问题。 另外,当我在网络浏览器中打开闪亮的应用程序时,问题就消失了。 这

How to build qpdf on Windows?

When running the checks for my R-package (via devtools::check() ) I face the warning ''qpdf' is needed for checks on size reduction of PDFs . I found this question were it was suggested (if I understood the answer correctly) to run Sys.which(Sys.getenv("R_QPDF", "qpdf")) and see whether qpdf is found or not. In my case this just returns qpdf "" so,

如何在Windows上构建qpdf?

当运行我的R软件包的检查时(通过devtools::check() ),我面临警告''qpdf' is needed for checks on size reduction of PDFs 。 我发现这个问题是它建议(如果我正确理解答案)运行Sys.which(Sys.getenv("R_QPDF", "qpdf"))并查看是否找到qpdf。 在我的情况下,这只是返回 qpdf "" 所以,我想我没有正确安装qpdf。 不幸的是,在Windows上安装qpdf似乎相当复杂。 我的第一个

join with empty suffix

Fair warning: this can hang your operating system. *_join() from dplyr fails when either of the left or right suffixes are specified as empty ( '' ), eg inner_join(data.frame(x=1, y=2), data.frame(x=1, y=3), by='x', suffix=c('', '.b')) Whereas the following works fine: inner_join(data.frame(x=1, y=2), data.frame(x=1, y=3), by='x'

加入空后缀

公平的警告:这会挂起你的操作系统。 当左侧或右侧后缀中的任一个被指定为空( '' )时,来自dplyr *_join()失败,例如 inner_join(data.frame(x=1, y=2), data.frame(x=1, y=3), by='x', suffix=c('', '.b')) 鉴于以下工作正常: inner_join(data.frame(x=1, y=2), data.frame(x=1, y=3), by='x', suffix=c('.a', '.b')) 同时,S3泛型merge()

Plot 3D prisms using ggplot2 and plotly

I have a list a with three matrices and a vector h with three heights (any positive real number). These matrices form triangles, that is, the base of the prism. I want to add the information of vector h to construct prisms. I've created a function to plot graphics in 2D ( pplot ). How can I plot the prisms as in the figure below? Let pplot and a toy problem be an example: library(ggpl

用ggplot2绘制3D棱镜并绘制

我有一个列表a有三个矩阵和矢量h三种高度(任意正实数)。 这些矩阵形成三角形,即棱镜的底部。 我想添加矢量h的信息来构造棱镜。 我创建了一个函数来绘制2D图形( pplot )。 我如何绘制如下图所示的棱镜? 让pplot和玩具问题成为一个例子: library(ggplot2) pplot <- function(polygon){ polygon <- lapply(polygon, function(x) {colnames(x) <- NULL; x}) vertex_number = nrow(polygon[[1]]) g = gg

how to set limits on rounded facet wrap y axis?

I have this plot and I need to round the y axis so what appears is acceptable EXCEPT for the fact that I would like to not just show 1 value on the y axis. I'd like to add the "limit" to the "scale_y_continuous" function so that the limits for each facet plot are unique to the individual facet. here is the plot only showing 60 and 80 on the y axis dat = data.frame(x =

如何设置包围y轴的圆面的限制?

我有这个阴谋,我需要围绕y轴,所以看起来是可以接受的除了我不想在y轴上显示1的值。 我想将“限制”添加到“scale_y_continuous”函数,以便每个方面图的限制对于各个方面都是唯一的。 这里是仅在y轴上显示60和80的情节 dat = data.frame(x = c(1,2,3,1,2,3),A=c(80.6, 82,83,60,61,62),A_up =c(81,84,85,62,63,64), A_low =c(79,78,81,59,58,57), group = c("z","z","z","y","y","y")) ggplot(data=dat , aes(x=as.factor(x), y

Integrating R with existing C# website

We have existing website built in C# and hosted on a shared Windows server. The aim is to build a simple app within existing website that would take in some data, entered by user, and process it using some R scripts (some statistics) and publish the output on the website in a static (dynamic?) format. Basic requirements: Secure Relatively inexpensive Low maintenance requirements What a

将R与现有C#网站集成

我们有用C#构建的现有网站,并托管在共享的Windows服务器上。 其目的是在现有网站中构建一个简单的应用程序,该应用程序将接收用户输入的一些数据,并使用一些R脚本(某些统计数据)处理该数据,并以静态(动态?)格式在网站上发布输出。 基本要求: 安全 相对便宜的 低维护要求 现有的选择是什么? 考虑到他们的繁重活动(Revolution R),微软是否提供开箱即用的解决方案? 如果托管公司(私人托管)允许R安

ggplot legends when plot is built from two data frames

I have data coming from two different data frames. I am trying to create legend for each data frame. I know I can combine the data frame and do it, but because of my data source it makes the most sense to plot from two different data frames. Please find the simplified example below. I have gotten close but the 'Main Forecast' in the legend is only white color. I want to show where &

从两个数据框构建绘图时,ggplot传说

我有来自两个不同数据框的数据。 我正在尝试为每个数据框创建图例。 我知道我可以结合数据框并做到这一点,但是由于我的数据源,从两个不同的数据框进行绘图是最有意义的。 请在下面找到简化的例子。 我已经接近了,但传说中的“主要预测”只是白色。 我想要显示“主要预测”在外侧是红色还是在内侧是白色。 x = seq(1,10, 1) y = seq(10,100, 10) df = data.frame(x=x, y=y) df2 = data.frame(x=5, y=50) p = ggplot(data=

Unable to load IRKernel in Jupyter notebook

I'm pretty new to the forum, so I'm sorry if this question has already been answered. I looked around, and although I saw that some had similar issues, I couldn't find the solution to my problem on any previous posts. So - here goes... I'm running Mac OS X 10.11.5, Jupyter notebook version 4.2.1, R version 3.2.2 I installed the R kernel for Jupyter notebook with the followin

无法在Jupyter笔记本中加载IRKernel

我对这个论坛很新,所以如果这个问题已经得到解答,我很抱歉。 我环顾四周,虽然我看到有些人有类似的问题,但我在以前的帖子中找不到解决问题的办法。 所以 - 这里去... 我正在运行Mac OS X 10.11.5,Jupyter笔记本版本4.2.1,R版本3.2.2 我使用以下命令安装了Jupyter笔记本的R内核 - conda install -c r r-irkernel 现在,当我启动Jupyter笔记本电脑时,我看到'R'是右侧“笔记本”下拉菜单中的一个选项。 但是

Update row(s) of a Shiny DataTable while maintaining position

I am creating a Shiny app that displays data.frame information at the top of the screen and specific variable stats at the bottom. The user can navigate the data.frame columns by interacting with a DT::datatable object. When a user clicks on a variable, detailed information is presented that can be edited. I would like this information to be updated and reflected in the datatable. My problem

在保持位置的同时更新Shiny DataTable的行

我正在创建一个Shiny应用程序,该应用程序在屏幕顶部显示data.frame信息,并在底部显示特定的变量统计信息。 用户可以通过与DT::datatable对象交互来导航data.frame列。 当用户点击一个变量时,会显示可编辑的详细信息。 我希望这些信息能够更新并反映在数据表中。 我的问题是,当我更新表格时,它从一开始就被渲染和显示。 如何在编辑后保留数据表的页面和行选择? 这是一个最小的工作示例,它显示DT::datatable中的mtc