当我将一个R Markdown文档编织成html时,我遇到了使用'nPlot'渲染rChart的问题.
我按照这个问题中讨论的解决方案,但没有成功.
这是我的.Rmd代码
```{r, echo=FALSE}
library(knitr)
```
---
title: "Untitled"
author: "Test"
date: "01/23/2015"
output: html_document
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can …Run Code Online (Sandbox Code Playgroud) 我正试图从这个网站上搜索材料:http://www.appliedsolutions.org/site/308/Local-Government/Local-Government-Affiliates
具体来说,我有兴趣从页面源代码第598行附近的javascript中提取值:
{
"title": 'Coconino County',
"lat": '35.7714',
"lng": '-111.5111',
"description": 'Coconino County, AZ <br/> <a href="http://www.coconino.az.gov/" target="_blank"> http://www.coconino.az.gov/</a> <br/> '
}
,
{
"title": 'City of Flagstaff',
"lat": '35.1981',
"lng": '-111.6506',
"description": 'City of Flagstaff, AZ <br/> <a href="http://www.flagstaff.az.gov/ " target="_blank"> http://www.flagstaff.az.gov/ </a> <br/> '
}
Run Code Online (Sandbox Code Playgroud)
理想情况下,我想将"title","lat"和"lng"值带入R中data.frame.
我已经使用readLinesR中的函数来读取页面,但是在减少html以隔离我需要的数据方面遇到了麻烦.
我有一个大的时间序列数据集,其中一个变量是事件保存为因子的日期和时间.我想创建一个矩阵热图,其中x轴显示星期几,y轴显示一天中的时间,因此我们可以看到特定事件发生了多少事件.
我已经能够使用plotCalendarHeatmapTime Projection r包根据时间序列的日期和月份创建频率热图.但是我无法绘制一些近似于一天中的某天与一天中的时间情景.
以下是一些示例代码,类似于我的数据集中的代码:
x <- c(1:18)
y <- factor(c("6/28/2013 7:23", "9/8/2013 17:59", "9/24/2013 10:46", "10/20/2013 18:05", "9/11/2013 17:36", "9/14/2013 23:27", "12/28/2013 6:48", "7/20/2013 17:26", "8/26/2013 7:51", "9/14/2013 9:12", "10/9/2013 22:01", "9/27/2013 16:52", "8/25/2013 8:22", "9/14/2013 23:26", "9/22/2013 18:29", "8/26/2013 21:57", "8/10/2013 13:53", "8/11/2013 17:25"))
data <- data.frame(x,y)
colnames(data) <- c("ID", "starttime")
Run Code Online (Sandbox Code Playgroud)