简体   繁体   中英

Basic plot using ggplot2 in R

I have a data frame t1 as follows:

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

I want to plot V2 vs V1 by using ggplot but unable to do it:

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

It gives me an error saying:

Error in readRDS(nsInfoFilePath): error reading from connection In addition: Warning message: In readRDS(nsInfoFilePath): error reading the file

How can I plot my data points? Thanks in advance.

The following works correctly -- I suspect you have a problem unrelated to plotting.

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()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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