How to use loess method in GGally::ggpairs using wrap function

I am trying to replicate this simple example given in the Coursera R Regression Models course: require(datasets) data(swiss) require(GGally) require(ggplot2) ggpairs(swiss, lower = list(continuous = "smooth", params = c(method = "loess"))) I expect to see a 6x6 pairs plot - one scatterplot with loess smoother and confidence intervals for each combination of the 6 variables in the swiss data.

如何使用wrap函数在GGally :: ggpairs中使用黄土方法

我正在尝试复制Coursera R回归模型课程中给出的这个简单示例: require(datasets) data(swiss) require(GGally) require(ggplot2) ggpairs(swiss, lower = list(continuous = "smooth", params = c(method = "loess"))) 我期望看到一个6x6对的图 - 一个散点图对于瑞士数据中的6个变量的每个组合都具有更平滑和可信的间隔。 但是,我收到以下错误: display_param_error()中的错误:'params'是一个不推荐的参数。

Is there a way to turn a ggpairs() plot into a ggplot2 object?

In a long but not complex analysis, I am generating a lot of ggplot2 plots, which are being dealt in the same programmatic way. I will also need matrix plots every now and then, but ggplot2 no longer implements any matrix plot function (since plotmatrix() is deprecated). Like suggested here, GGally's ggpairs() implements matrix plot nicely. The down side is that ggpairs() returns a ggpl

有没有办法将ggpairs()图变成ggplot2对象?

在漫长但不复杂的分析中,我产生了许多ggplot2图,这些图正在以相同的编程方式处理。 我现在也需要矩阵图,但ggplot2不再实现任何矩阵图函数(因为plotmatrix()不推荐使用)。 就像这里所建议的那样,GGally的ggpairs()很好地实现了矩阵图。 反过来说,ggpairs()返回的是一个ggplot2对象矩阵,而不是一个单一的ggplot2对象,所以我不能再以我在那之前处理的相同方式处理它。 因此我的问题。 有没有办法将ggpairs

Plotting RDA (vegan) in ggplot

I'm still new to R, trying to learn how to use the library vegan, which I can easily plot in R with the normal plot function. The problem arises when I want to plot the data in ggplot. I know I have to extract the right data from the list I've created, but which and how? The dataset I've been practicing on can be downloaded here https://drive.google.com/file/d/0B1PQGov60aoudVR3dVZB

在ggplot中绘制RDA(素食主义者)

我仍然对R很陌生,试图学习如何使用图书馆素食主义者,我可以使用正常的情节功能轻松地在R中绘制图素。 当我想在ggplot中绘制数据时出现问题。 我知道我必须从我创建的列表中提取正确的数据,但是哪些和如何? 我一直在练习的数据集可以在这里下载https://drive.google.com/file/d/0B1PQGov60aoudVR3dVZBX1VKaHc/view?usp=sharing我用来获取数据转换的代码是这样的: library(vegan) library(dplyr) library(ggplot2) library

R saving multiple ggplot2 plots as R

I would like to save multiple plots (with ggplot2) to a list during a large for-loop. And then subsequently display the images in a grid (with grid.arrange) I have tried two solutions to this: 1 storing it in a list, like so: pltlist[["qplot"]] <- qplot however for some reason this does save the plot correctly. So I resorted to a second strategy which is recordPlot() This was able to sa

R将多个ggplot2图作为R保存

我想在一个大的for循环中将多个图(使用ggplot2)保存到列表中。 然后随后在网格中显示图像(使用grid.arrange) 我已经尝试了两种解决方案:1将它存储在列表中,如下所示: pltlist[["qplot"]] <- qplot 但是由于某些原因,这确实可以保存绘图。 所以我诉诸第二个策略是recordPlot()这能够正确保存图,但无法在网格中使用它。 可再生的例子: require(ggplot2);require(grid);require(gridExtra) df <- data.

use ggpairs to create this plot

I have some code in a Shiny app that produces the first plot below. As you can see the font size varies with the size of the correlation coefficient. I would like to produce something similar with ggpairs (GGally) or ggplot2. The second image below was produced with the following code: library(GGally) ggpairs(df, upper = list(params = c(size = 10)), lower = list(continuous = "smooth", pa

使用ggpairs创建这个图

我在Shiny应用程序中创建了一些代码,可以生成下面的第一个图。 正如你所看到的,字体大小随着相关系数的大小而变化。 我想用ggpairs(GGally)或ggplot2来产生类似的东西。 下面的第二张图片是用下面的代码生成的: library(GGally) ggpairs(df, upper = list(params = c(size = 10)), lower = list(continuous = "smooth", params = c(method = "loess", fill = "blue")) ) 正如您所看到的,相关字体的大小可以使用

R: saving ggplot2 plots in a list

I am writing a R code that allows users to select columns from a data and plots histograms for each of them. Hence, I am using a 'for' loop to generate the required number of plots using the ggplot2 library and save them in a single list. But the problem I am facing is that, at every iteration of the 'for' loop, all objects in the list are storing the same plot. Thus, the final

R:将ggplot2图保存在列表中

我正在编写一个R代码,允许用户从数据中选择列并绘制每个列的直方图。 因此,我使用'for'循环来使用ggplot2库生成所需数量的图并将它们保存在单个列表中。 但是我面临的问题是,在'for'循环的每一次迭代中,列表中的所有对象都存储相同的图。 因此,最终输出由直方图的网格组成,标记不同,但描绘了相同(最后一个)列。 我知道这个问题已经很老了,我找到了在for循环中重命名ggplot2图的答案,并且https:/

Plot two graphs in same plot in R

I would like to plot y1 and y2 in the same plot. x <- seq(-2, 2, 0.05) y1 <- pnorm(x) y2 <- pnorm(x, 1, 1) plot(x, y1, type = "l", col = "red") plot(x, y2, type = "l", col = "green") But when I do it like this, they are not plotted in the same plot together. In Matlab one can do hold on , but does anyone know how to do this in R? lines() or points() will add to the existing graph,

在R中的同一图中绘制两幅图

我想在同一个图中绘制y1和y2。 x <- seq(-2, 2, 0.05) y1 <- pnorm(x) y2 <- pnorm(x, 1, 1) plot(x, y1, type = "l", col = "red") plot(x, y2, type = "l", col = "green") 但是当我这样做的时候,他们不会一起被绘制在同一个地块里。 在Matlab中,可以hold on ,但有谁知道如何在R中做到这一点? lines()或points()将添加到现有图形中,但不会创建新窗口。 所以你需要这样做 plot(x,y1,type="l",col="red")

time at a specified timezone, disregard daylights savings time

I have time series data obtained from a data logger that was set to one time zone without daylights savings (NZST or UTC+12:00), and the data spans a few years. Data loggers don't consider DST changes, and are synchronized to local time with/without DST (depending who deployed it). However, when I get the data into R, I'm unable to properly use as.POSIXct to ignore DST. I'm using

在特定时区的时间,无视夏令时节约时间

我从时间序列数据中获得数据记录器,该数据记录器被设置为一个时区而没有节约日光(NZST或UTC + 12:00),数据跨度数年。 数据记录器不考虑DST更改,并且与/不使用DST(取决于谁部署它)同步到本地时间。 但是,当我将数据导入R时,我无法正确使用as.POSIXct来忽略DST。 我在Windows计算机上使用R 2.14.0进行以下设置: > Sys.timezone() [1] "NZDT" > Sys.getlocale("LC_TIME") [1] "English_New Zealand.1252" 以

How to use cacheSweave in a batch Sweave call via make?

I've been using a makefile to automate the running of Sweave for my analysis reports in R using the approach outlined by Jeromy Anglim with great success. I recently heard about the cacheSweave package and I would like to incorporate that functionality into my Rnw file. I use the ProjectTemplate package to load all of the necessary files at startup, and that takes some time because I have t

如何通过make在批量Sweave调用中使用cacheSweave?

我一直在使用makefile来自动化运行Sweave,以便使用Jeromy Anglim概述的方法在R中为我的分析报告取得巨大成功。 我最近听说过cacheSweave软件包,我想将该功能合并到我的Rnw文件中。 我使用ProjectTemplate包在启动时加载所有必需的文件,这需要一些时间,因为我必须预处理原始数据文件。 cacheSweave小插图中的示例显示了如何在R会话中使用cacheSweave驱动程序运行Sweave: library(cacheSweave) Sweave("foo.Rnw", driver =

How can I view the source code for a function?

I want to look at the source code for a function to see how it works. I know I can print a function by typing its name at the prompt: > t function (x) UseMethod("t") <bytecode: 0x2332948> <environment: namespace:base> In this case, what does UseMethod("t") mean? How do I find the source code that's actually being used by, for example: t(1:10) ? In other cases,

我如何查看函数的源代码?

我想看看函数的源代码,看看它是如何工作的。 我知道我可以通过在提示符处输入它的名字来打印一个函数: > t function (x) UseMethod("t") <bytecode: 0x2332948> <environment: namespace:base> 在这种情况下, UseMethod("t")是什么意思? 我如何找到实际使用的源代码,例如: t(1:10) ? 在其他情况下,我可以看到R函数被调用,但我找不到这些函数的源代码。 > ts.union function (..., d