R错误:无法找到函数“ggplot”
问题描述:
我要运行该脚本,但它表明R错误:无法找到函数“ggplot”
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()
答
它发生在我的R'当包在environnant损坏或无法确定因为依赖性的改变。建议可能是你重新安装ggplot2,并确保你可以重新编译它。
投票重新打开:这不是一个合适的重复。 OP显式在其代码中包含'library(ggplot2)'。我不知道发生了什么,但这不是那个FAQ。 https://stackoverflow.com/questions/7027288/error-could-not-find-function-in-r是更一般的,但我不认为任何列出的答案适用于这个问题。 –
请问我们可以有'sessionInfo()'的结果吗? –
我面临同样的问题。我已经安装了ggplot2,但是使用库(ggplot2)给了我OP所述的错误。 –