Error: `x` must be a string or a R connection

Viewed 327

I have a question regarding the proper usage of aes_string() some.data is a data frame that contains a column named 'x'.

print(some.data)
print(some.data$x)
p=  ggplot()+
    geom_raster(data=reshape2::melt(d), aes_string(x="Var1",y="Var2",fill="value"),interpolate=FALSE)+
    scale_fill_gradient(low = "black", high = "white")+ guides(fill=FALSE)+
    geom_path(data=some.data,
              aes_string(x="x", y="y",group="indexPerFile", color = shQuote(color)))+

The Traceback shows that the problem was in the last line and the Error message was

Error: `x` must be a string or a R connection 

should aes_string be used within a different function?

0 Answers
Related