I am new to R and have a problem on running a ggplot
command. Below is my code. The program exits immediately without showing the diagram. Is there anything wrong with my code?
#!/usr/bin/env Rscript
library(ggplot2)
data <- read.csv(file="./data/assignment-02-data.csv",head=TRUE,sep=",")
head(data)
nrow(data)
print(ggplot(data, aes(longitude, latitude)) + geom_point())
From this post: Generate multiple graphics from within an R function. It says that I need to print the value but it is not working.
I am running the program from shell ./myr.r
.