I have the problem with the ggplot
.
The data samples:
> data
[1] "KemData"
> depVal
[1] "Урожайность т/га"
> facVal1
[1] "Предшествующая культура"
When I try to build a plot with the following parameters:
ggplot(get(data), aes(fill=as.name(depVal), y=as.name(depVal), x=Год))
It gives me the following error:
Don't know how to automatically pick scale for object of type name. Defaulting to continuous.
Error: Aesthetics must be valid data columns. Problematic aesthetic(s): y = as.name(depVal), fill = as.name(depVal).
But if I avoid using as.name
, then ggplot won't work with double quotes as an input.
I also tried to replace quotes with gsub
but it doesn't seem to work