繁体   English   中英

基本 plot 在 R 中使用 ggplot2

[英]Basic plot using ggplot2 in R

我有一个数据框t1如下:

   V1    V2
1  1 83.60687
2  2 83.90725
3  3 84.03346
4  4 85.89171

我想通过使用 ggplot 来 plot V2 vs V1 但无法做到:

library(ggplot2)
ggplot(data = t1, aes(x = V1, y = V2)) + 
geom_point()

它给了我一个错误说:

readRDS(nsInfoFilePath) 中的错误:从连接中读取错误另外:警告消息:在 readRDS(nsInfoFilePath) 中:读取文件时出错

我怎样才能 plot 我的数据点? 提前致谢。

以下工作正常 - 我怀疑你有一个与绘图无关的问题。

V1 = c(1,2,3,4)
V2 = c(83,84,85,86)

t1=data.frame(V1,V2)

library(ggplot2)
ggplot(data = t1, aes(x = V1, y = V2)) + 
  geom_point()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM