You just need to use aes_string
instead of aes
, like this:
ggplot(data=t, aes_string(x = "w", y = i)) + geom_line()
Note that w
then needs to be specified as a string, too.
More Related Contents:
- How to use a variable to specify column name in ggplot
- “for” loop only adds the final ggplot layer
- ggplot does not work if it is inside a for loop although it works outside of it [duplicate]
- Save multiple ggplots using a for loop
- Multiple plots in for loop ignoring par
- dplyr: How to use group_by inside a function?
- Creating multiple graphs based upon the column names
- Why is enquo + !! preferable to substitute + eval
- pass function arguments to both dplyr and ggplot
- rlang::sym in anonymous functions
- How to combine ggplot and dplyr into a function?
- R: Using a string as an argument to mutate verb in dplyr
- show multiple plots from ggplot on one page in r
- Changing fonts in ggplot2
- ggplot2: sorting a plot
- Subscript letters in ggplot axis label
- Plotting lines and the group aesthetic in ggplot2
- How to fill geom_polygon with different colors above and below y = 0 (or any other value)?
- Formatting dates with scale_x_date in ggplot2
- Making a stacked area plot using ggplot2
- How do I show the y value on tooltip while hover in ggplot2
- Seeking workaround for gtable_add_grob code broken by ggplot 2.2.0
- use ggpairs to create this plot
- Reverse datetime (POSIXct data) axis in ggplot
- R – ggplot2 issues with date as character for x-axis
- ggplot2: Setting geom_bar baseline to 1 instead of zero
- Combined plot of ggplot2 (Not in a single Plot), using par() or layout() function? [duplicate]
- Plot background colour in gradient
- Different axis limits per facet in ggplot2
- Relocating Alaska and Hawaii on thematic map of the USA with ggplot2