我试图制作一个包,但是当我运行document()时,它会打印NAMESPACE not generated by roxygen2. Skipped.,我试图在我的函数中使用ggplot2,XML, R6包。我以下列方式进口:
#' @rdname visualization
#' @param hist_data A table of weather variables with PWS created by hist_data function
#' @param variable A character string of variable name
#'
我在将ggplot2安装到R中时遇到了问题。我在这里看了看,没有看到与我得到的相同的错误。
> install.packages('ggplot2', dep=TRUE)
Warning in install.packages("ggplot2", dep = TRUE) :
'lib = "C:/Program Files/R/R-2.13.1/library"' is not writable
Error in install.packages("ggplot2", dep = TRUE) :
在shiny中使用R时,我对打印动态输出感到有点困惑。以下是我在shiny中的代码,它只能打印出ggplot2图表,但不能打印出新的数据框架。我只想知道如何同时打印"mydata“。谢谢。
library("reshape2")
library("ggplot2")
Server.R
shinyServer(function(input, output) {
output$main_plot <- renderPlot({
#Draw gragh to compare the forecast values with real data
例如,在R会话中,键入library(ggplot2)和library("ggplot2")可以导入库ggplot2。但是,如果我在交互式会话中键入ggplot2,就会得到:
> ggplot2
Error: object 'ggplot2' not found
因此,显然ggplot2不是一个对象。库()如何在不抱怨未定义变量的情况下接受它?
我有一个函数,它根据mtcar中“齿轮”的唯一值创建一个情节列表。
library(datasets)
library(magrittr)
library(ggplot2)
library(dplyr)
make_plots <- function(data) {
### create list of plot objects for every unique value of 'gear' (from mtcars)
p_list <- lapply(sort(unique(data$gear)), function(i) {
ggplot
我一直在尝试为包含一个ggplot2图的考试包创建一个R标记的考试问题。
这里有一个reprex:
```{r}
图书馆(Ggplot2)
图书馆(Tibble)
X <- data_frame(x =r范数(100,50,25),y=x+r范数(100,0,15))
Question
========
```{r}
Geom_point(x= x,y=y)
What is true about the plot?
Answerlist
----------
* The relationship is strong
* The relationship is weak
Solutio