Making multiple plots from a list of data frames

I have a list of 21 different data frames called "proc.r1". I'm trying to make 21 graphs, each one using data from each of the data frame in the list. What I did below only works with the first data frame in the list. The ggplot I wrote for "plotdf1" is the graph I need generated from each data frame. So I need 21 of identical-looking "plotdf1" except that

从数据框列表中制作多个图

我有一个名为“proc.r1”的21个不同数据框的列表。 我试图制作21个图表,每个图表使用列表中每个数据框的数据。 我在下面做的只适用于列表中的第一个数据框。 我为“plotdf1”写的ggplot是我需要从每个数据帧生成的图。 所以我需要21个相同的“plotdf1”,只是每个人都会显示来自不同数据帧的数据。 #making the first data frame in the "proc.r1" list as a separate data frame df1 <- as.data.frame(proc.r1 [[1]

Quantmod, getSymbols error trying to replicate answer

I just downloaded the package Quantmod and have been playing with getSymbols . I want to be able to get data for multiple stocks as in this question: getSymbols and using lapply, Cl, and merge to extract close prices. Unfortuantely, when I try to duplicate the answer: tickers <- c("SPY","DIA","IWM","SMH","OIH","XLY", "XLP","XLE","XLI","XLB","XLK","XLU") getSymbols(tickers, from="2

Quantmod,getSymbols错误尝试复制答案

我刚刚下载了Quantmod软件包,并且一直在玩getSymbols 。 我希望能够获得多个股票的数据,如下面的问题所示:getSymbols并使用lapply,Cl,并合并以提取收盘价格。 不幸的是,当我尝试复制答案时: tickers <- c("SPY","DIA","IWM","SMH","OIH","XLY", "XLP","XLE","XLI","XLB","XLK","XLU") getSymbols(tickers, from="2001-03-01", to="2011-03-11") 我收到以下错误消息: Error in download.file(paste(yaho

Sweave to R markdown file conversion

I am not sure if this type of question complies with the SO rules for well-defined questions ;) ... anyway: I want to convert several R Sweave files ( .Rnw ) to R markdown files ( .Rmd ). Jeromy Anglin has posted on this matter here but there is no code supplied. I tried to use pandoc , but of course pandoc cannot handle the chunk tags and inline code tags correctly. Consclusion : I guess I

Sweave to R降价文件转换

我不确定这种类型的问题是否符合针对明确定义的问题的SO规则;)...无论如何: 我想将几个R Sweave文件( .Rnw )转换为R .Rmd文件( .Rmd )。 Jeromy Anglin在这里发布了这个问题,但没有提供代码。 我尝试使用pandoc ,但当然pandoc无法正确处理块标签和内联代码标签。 结论 :我想我会写一些代码来解析我的.Rnw文件,为pandoc转换做好准备。 因此我的问题是: 有更好的方法去吗? 偶然的人有可用的代码来完成这项

Wordcloud in different shapes in R

I have created a wordcloud in R using package "wordcloud". But It is plotting wordcloud in any random shape. I want wordcloud in circular or Ellipse shape. Is there any facility provided by R to create wordcloud in different shapes? Wordcloud does create wordclouds in a circle I believe -- if it doesn't look circular, play around with the scale of the words and their minimum

在R中有不同形状的Wordcloud

我使用package“wordcloud”在R中创建了一个wordcloud。 但它正在以任意形状绘制wordcloud。 我想要圆形或椭圆形的wordcloud。 R有没有提供任何设施来创建不同形状的wordcloud? Wordcloud确实在一个圈子里创建了wordclouds,我相信 - 如果它看起来不是循环的话,那么可以围绕这些词汇的规模以及它们的最小频率来进行包容。 然而,根据您的原始单词数据集的不同,可能很难将其变为真正的wordcloud形状。 这里有一个很密集

How to code a multiparameter log

I would like to estimate power of the following problem. I am interested in comparing two groups that both follow Weibull distribution. So, group A has two parameters (shape par = a1,scale par = b1) and two parameters has group B (a2, b2). By simulating random variables from distribution of interest (for example assuming different scale and shape parameters, ie a1=1.5*a2, and b1=b2*0.5; or eit

如何编写多参数日志

我想估计以下问题的力量。 我有兴趣比较两个都遵循Weibull分布的团队。 因此,A组有两个参数(shape par = a1,scale par = b1)和两个参数组B(a2,b2)。 通过模拟感兴趣分布的随机变量(例如,假设不同的尺度和形状参数,即a1 = 1.5 * a2和b1 = b2 * 0.5;或者组之间的差异仅在任一形状或尺度参数中)似然比检验来检验a1 = a2和b1 = b2(或者例如a1 = a1,当我们知道b1 = b2时),并估计检验的功效。 问题是什么是完整模

Walking a hierarchical tree

I want to be able to "walk" (iterate) through a hierarchical cluster (see figure below and code). What I want is: A function that that takes a matrix and a minimum height. Say 10 in this example. splitme <- function(matrix, minH){ ##Some code } Starting from the top to minH , start cutting whenever there is a new split. This is the first problem. How to detect a new split

走分层树

我希望能够“遍历”(遍历)一个层次结构的集群(参见下图和代码)。 我想要的是: 一个需要矩阵和最小高度的函数。 在这个例子中说10。 splitme <- function(matrix, minH){ ##Some code } 从顶部开始到minH ,每当有新的分割时就开始切割。 这是第一个问题。 如何检测新的分裂以获得高度h 。 在这个特定的h ,有多少个簇? 检索集群 mycl <- cutree(hr, h=x);#x is that found h count <- count(mycl)#

knit .rmd file to .md and save the .md file one level up with a different name

I have a .rmd file called mycode.rmd saved in a subdirectory called root/scripts on github. R Markdown ======================================================== I'd like to find a way to 'knit to HTML' in RStudio and have the resulting .md file save one level up in the root directory with a different name, README.md, so Github will display it. ```{r, results='hide'} math <- 1 + 1 ``` This

将.rmd文件编织为.md并将.md文件另存为一个不同的名称

我有一个名为mycode.rmd的.rmd文件保存在github上名为root/scripts的子目录中。 R Markdown ======================================================== I'd like to find a way to 'knit to HTML' in RStudio and have the resulting .md file save one level up in the root directory with a different name, README.md, so Github will display it. ```{r, results='hide'} math <- 1 + 1 ``` 这样,根文件夹中的REA

World map with R?

I have an array that tells me the number of observations per country. countries <- structure(c(532L, 3L, 1L, 15L, 1L, 1L, 2L, 3L, 16L, 2L, 43L, 1L, 2L, 2L, 1L, 1L, 1L, 3L, 2L, 1L, 4L, 4L, 16L, 13L, 2L, 2L, 9L, 1L, 1L, 5L, 3L, 5L, 1L, 1L, 3L, 1L, 10L, 11L, 4L, 2L, 1L, 7L, 1L, 2L, 6L, 7L, 1L, 6L, 1L, 2L, 7L, 1L, 20L, 1L, 2L, 1L, 3L, 2L, 5L, 76L, 2L, 1L, 1L), .Dim = 63L, .Dimnames = structur

与R的世界地图?

我有一个数组,告诉我每个国家的观察次数。 countries <- structure(c(532L, 3L, 1L, 15L, 1L, 1L, 2L, 3L, 16L, 2L, 43L, 1L, 2L, 2L, 1L, 1L, 1L, 3L, 2L, 1L, 4L, 4L, 16L, 13L, 2L, 2L, 9L, 1L, 1L, 5L, 3L, 5L, 1L, 1L, 3L, 1L, 10L, 11L, 4L, 2L, 1L, 7L, 1L, 2L, 6L, 7L, 1L, 6L, 1L, 2L, 7L, 1L, 20L, 1L, 2L, 1L, 3L, 2L, 5L, 76L, 2L, 1L, 1L), .Dim = 63L, .Dimnames = structure(list( c("United States"

Convert latitude/longitude to state plane coordinates

I've got a dataset with latitude and longitude which I'd like to convert to the state plane coordinates for Illinois East, using EPSG 2790 (http://spatialreference.org/ref/epsg/2790/) or maybe ESRI 102672 (http://spatialreference.org/ref/esri/102672/). This has definitely been asked before; my code is based on the answers here ("Non Finite Transformation Detected" in spTransf

将纬度/经度转换为状态平面坐标

我有一个经纬度数据集,我想使用EPSG 2790(http://spatialreference.org/ref/epsg/2790/)或ESRI 102672( http://spatialreference.org/ref/esri/102672/)。 这肯定是以前被问过的; 我的代码基于这里的答案(rgdal R Package中的spTransform中的“Non Finite Transformation Detected”和http://r-sig-geo.2731867.n2.nabble.com/Converting-State-Plane-Coordinates-td5457204。 HTML)。 但由于某种原因,我无法实现它的

Running regression tree on large dataset in R

I am working with a dataset of roughly 1.5 million observations. I am finding that running a regression tree (I am using the mob() * function from the party package) on more than a small subset of my data is taking extremely long (I can't run on a subset of more than 50k obs). I can think of two main problems that are slowing down the calculation The splits are being calculated at each s

在R中的大数据集上运行回归树

我正在处理大约150万个观测数据集。 我发现运行一个回归树(我使用party包中的mob() *函数)在我的数据的一小部分子集上花费了很长时间(我无法运行超过50k obs的子集)。 我可以想到两个主要的问题,即放慢计算速度 在每一步使用整个数据集计算分裂。 只要它继续补充树中每个子节点上样本的大小,我就会对选择变量在每个节点上基于数据的随机子集进行拆分的结果感到满意。 该操作未被并行化。 在我看来,只要树已经完