R 打印数据框中的所有列

R 打印数据框中的所有列,r,plot,R,Plot,我想将所有列Wine_1到Wine_30绘制在第7页的一个平滑线条图中,我正在尝试以下操作: #Imports Dataset library(readxl)# RMN <- read_excel("~/R/ProyectoAspectosAnaliticos/DatosDeVinos.xlsx", sheet=7) RMN <- as.data.frame(RMN) attach(RMN) plot(PPM,Wine_1,type="l",c

我想将所有列Wine_1到Wine_30绘制在第7页的一个平滑线条图中,我正在尝试以下操作:

#Imports Dataset
library(readxl)#
RMN <- read_excel("~/R/ProyectoAspectosAnaliticos/DatosDeVinos.xlsx", sheet=7)
RMN <- as.data.frame(RMN)
attach(RMN)
plot(PPM,Wine_1,type="l",col="red")
lines(PPM,Wine_2,col="green")
#And I can take from here to the 30 but that will not be optimal to do
导入数据集 图书馆(readxl)#
RMN您可以将数据帧转换为长格式,然后使用
facet\u wrap()
按变量拆分绘图:

require(tidyverse)
require(ggplot2)
RMN    = read.xlsx("DatosDeVinos.xlsx", sheet = "RMN")
df     = subset(RMN, selec = -c(Value))
dfLong = gather(df, key = "Variable", value="Value", -PPM)
ggplot(dfLong, aes(x=PPM, y = Value)) + facet_wrap(~Variable) + theme_bw() +
  theme(panel.spacing = unit(0, "lines"))

谢谢,它成功了如果它解决了您的问题,您介意将此标记为已解决吗?