想要在一页上画两幅图片。以为例,它不起作用。错误是could not find function "multiplot"。
但是ggplot2是可绘制的,我也重新安装了R、ggplot2、重新启动等等。我做错了什么吗?
library(ggplot2)
# This example uses the ChickWeight dataset, which comes with ggplot2
# First plot
p1 <-
ggplot(ChickWeight, aes(x=Time, y=weight, colour=Diet, group=Chick))
当我在闪亮的环境中运行程序时,我得到了Error: Invalid input: time_trans works with objects of class POSIXct only。这是我在shiny中的代码
library(ggplot2)
library(Cairo) # For nicer ggplot2 output when deployed on Linux
library(shiny)
ui <- fluidPage(
fluidRow(
column(width = 4, class = "well",
h4(&
我正在使用ggplot和ggplot.multiplot函数来绘制每页的多个图(2列图),但我做不到。请帮帮忙
我在变量plot_list中有一个ggplots列表,并使用函数ggplot2.multiplot绘制每页2幅图。但它把所有的数字都画在一页纸上,搞砸了。我要一页两幅图。
>plot_list ## ggplot saved in a list though i have long list to plot
[[1]]
[[2]]
[[3]]
[[4]]
在这两种情况下,我都试过了,但所有四个情节都是在同一页中绘制的:
library(easyGgplot2)
libra
我想用不同的数据文件(a.xlsx,b.xlsx,c.xlsx)使用R代码绘制多个图形。
我已经使用R编写了一段代码,但它出现了错误。
让我知道如何解决这个错误。
'''Example R code'''
library(readxl)
library(ggplot2)
a <- read_excel("D:/a.xlsx")
b <- read_excel("D:/b.xlsx")
c <- read_excel("D:/c.xlsx")
plot1 <- ggplo
- EuropeIndia数据
我的数据集在一个名为location的变量中有45个不同的国家/地区我正在尝试将每个国家/地区的数据子集,并为每个国家/地区绘制散点图。当我运行应用程序时,该图不会出现,并且会收到2个警告
警告1: select输入"location“包含大量选项;请考虑使用服务器端selectize来大幅提高性能。请参阅?selectizeInput帮助主题的详细信息部分。警告2:“错误在cat中:参数1(类型'list')不能被'cat‘102处理: cat”这是我使用的代码,请告诉我哪里出错了,谢谢!
# This is a Shin
我有一个函数,它根据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
我正在用gganimate生成一个gif,我想对绘图格式做一些调整,这些调整只能通过将ggplot对象转换为gtable来完成。例如,我想更改情节标题的位置,以便它总是出现在情节的左下角。
下面是情节调整的一个例子:
library(ggplot2)
library(gganimate)
library(dplyr)
# Helper function to position plot title all the way to left of plot
align_titles_left <- function(p, newpage = TRUE) {
p_built <-
所以我的第一个ggplot2盒图只是一个很大的扩展框图,第二个是正确的,但是我不明白什么改变了,为什么第二个改变了。我是R和ggplot2的新手,如果可以的话请告诉我,谢谢。
#----------------------------------------------------------
# This is the original ggplot that didn't work:
#----------------------------------------------------------
zSepalFrame <- data.frame(zSepalLe