mario
mario copied to clipboard
quality of life: display a single dataframe by itself without a pipe (also pairs well with ggplot)
It would be nice to just display a dataframe by itself without doing %>% I(). i think the easiest thing to do is to have the 'code' be the name of the dataframe itself and the LHS be that dataframe, with a blank RHS. that way, my frontend will know just to render LHS dataframe and not an LHS -> RHS pair.
Another benefit of supporting solo dataframe views is that it will work well with ggplot. Currently with ggplot, it's annoying to have to do mpg %>% I() just to activate mario here:
library(dplyr)
library(ggplot2)
mpg %>% I() %>% ggplot(aes(displ, hwy, colour = class)) +
geom_point()
also, i think assignments to ggplot don't work, like:
library(dplyr)
library(ggplot2)
my_plot <- mpg %>% I() %>% ggplot(aes(displ, hwy, colour = class)) +
geom_point()```
- [ ] single df
- [ ] single gg obj
- [ ] df %>% ggplot() + ...
- [ ] df <- tibble(A = 1)
- [ ] gg_obj <- df %>% ggplot() + ...
- [ ] gg_obj2 <- gg_obj