使用 ggplot2 创建绘图时遇到问题
> setwd("c:/tesis/emisiones")
e<-read.csv("fh3pco1.csv",header=T)
attach(e)
names(e)
1 “VehCat” “组件” “TrafficSit” “子段” “SizeClasse” “V” “EFA”
[8] “norma” “cat” “cat1”
library(ggplot2)
length(e)
1 10
vpge0 <- function(x) {(281* x^-0.63)}
情节没有错误
ggplot(e, aes(x=V,y=EFA, colour=norma)) + geom_point(size=4)
情节错误
ggplot(e, aes(x=V,y=EFA, colour=norma)) +
geom_point(size=4)+
stat_function(data = data.frame(x = 1:100, FE = factor(1)),fun = vpge0, size=1)