|
140 | 140 | } |
141 | 141 |
|
142 | 142 | if (n.numeric == 1L) { |
143 | | - pl = ggplot2::ggplot(grid, ggplot2::aes_string(x = par.names[numeric.idx], y = "y")) + geom_line() |
| 143 | + num.par = par.names[numeric.idx] |
| 144 | + pl = ggplot2::ggplot(grid, ggplot2::aes(x = .data[[num.par]], y = .data[["y"]])) + geom_line() |
144 | 145 | } |
145 | 146 | if (n.numeric == 2L) { |
146 | | - pl = ggplot2::ggplot(grid, ggplot2::aes_string(x = par.names[numeric.idx[1L]], y = par.names[numeric.idx[2L]])) |
| 147 | + num.par1 = par.names[numeric.idx[1L]] |
| 148 | + num.par2 = par.names[numeric.idx[2L]] |
| 149 | + pl = ggplot2::ggplot(grid, ggplot2::aes(x = .data[[num.par1]], y = .data[[num.par2]])) |
147 | 150 | if (render.levels) { |
148 | 151 |
|
149 | 152 | if (!requireNamespace("RColorBrewer", quietly = TRUE)) |
|
152 | 155 | # see http://learnr.wordpress.com/2009/07/20/ggplot2-version-of-figures-in-lattice-multivariate-data-visualization-with-r-part-6/ |
153 | 156 | brewer.div = colorRampPalette(RColorBrewer::brewer.pal(11, "Spectral"), interpolate = "spline") |
154 | 157 |
|
155 | | - pl = pl + ggplot2::geom_raster(ggplot2::aes_string(fill = "y")) |
| 158 | + pl = pl + ggplot2::geom_raster(ggplot2::aes(fill = .data[["y"]])) |
156 | 159 | pl = pl + ggplot2::scale_fill_gradientn(colours = brewer.div(200)) |
157 | 160 | } |
158 | 161 | if (render.contours) { |
159 | | - pl = pl + ggplot2::stat_contour(ggplot2::aes_string(z = "y"), colour = "gray", alpha = 0.8) |
| 162 | + pl = pl + ggplot2::stat_contour(ggplot2::aes(z = .data[["y"]]), colour = "gray", alpha = 0.8) |
160 | 163 | } |
161 | 164 | } |
162 | 165 |
|
|
181 | 184 | # get optima coordinates in a nice data.frame |
182 | 185 | opt.df = getOptimaDf(x) |
183 | 186 | if (n.numeric == 1L) { |
184 | | - pl = pl + ggplot2::geom_point(opt.df, mapping = ggplot2::aes_string(x = par.names[numeric.idx[1L]], y = "y", colour = "optima", shape = "optima")) |
| 187 | + num.par1 = par.names[numeric.idx[1L]] |
| 188 | + pl = pl + ggplot2::geom_point(opt.df, mapping = ggplot2::aes(x = .data[[num.par1]], y = .data[["y"]], colour = .data[["optima"]], shape = .data[["optima"]])) |
185 | 189 | } else { |
186 | | - pl = pl + ggplot2::geom_point(opt.df, mapping = ggplot2::aes_string(x = par.names[numeric.idx[1L]], y = par.names[numeric.idx[2L]], colour = "optima", shape = "optima")) |
| 190 | + num.par1 = par.names[numeric.idx[1L]] |
| 191 | + num.par2 = par.names[numeric.idx[2L]] |
| 192 | + pl = pl + ggplot2::geom_point(opt.df, mapping = ggplot2::aes(x = .data[[num.par1]], y = .data[[num.par2]], colour = .data[["optima"]], shape = .data[["optima"]])) |
187 | 193 | # opt.df$y = round(opt.df$y, digits = 2L) |
188 | | - # pl = pl + geom_text(opt.df, mapping = aes_string(x = par.names[numeric.idx[1L]], y = par.names[numeric.idx[2L]], label = "y")) |
| 194 | + # pl = pl + geom_text(opt.df, mapping = aes(x = par.names[numeric.idx[1L]], y = par.names[numeric.idx[2L]], label = "y")) |
189 | 195 | } |
190 | 196 | } |
191 | 197 |
|
|
0 commit comments