-1

I want to run this script but it show

Error in ggplot(rawdata, aes(x = Subject, y = a)) : could not find function "ggplot"

# Plotting 
library(ggplot2)
library(reshape2)
rawdata <- read.csv("Plotdata.csv", header=TRUE)
ggplot(rawdata, aes(x=Subject, y=a)) + geom_point()
Derek Brown
  • 4,232
  • 4
  • 27
  • 44
  • 2
    voting to reopen: this is not an appropriate duplicate. The OP explicitly has `library(ggplot2)` in their code. I don't know what's going on, but it's not that FAQ. https://stackoverflow.com/questions/7027288/error-could-not-find-function-in-r is more general, but I don't think any of the answers listed there apply to this question. – Ben Bolker Nov 04 '17 at 23:03
  • can we have the results of `sessionInfo()` please? – Ben Bolker Nov 04 '17 at 23:03
  • 1
    I am facing the same issue. I have installed ggplot2 but using library(ggplot2) is giving me the error as mentioned by OP. – Saurabh Jain Dec 21 '17 at 17:27

1 Answers1

1

It happens to my R when the package in the environnant is broken or could not be identified because of the dependency change . Recommendation could be you reinstall ggplot2 and make sure you could library it again.

exteral
  • 991
  • 2
  • 12
  • 33