EvaMaeRey / little_flipbooks_library

35 stars 13 forks source link

class: split-40 count: false shows in slides and slides don't behave as expected #4

Closed novica closed 5 years ago

novica commented 5 years ago

Again, I am not sure if this is an issue or I am just not using the templates properly.

When I try to make a plot with the latest tidy tuesday data I get this in the slides:

Screenshot_20190916_232026

I am recreating your slow ggplot example and the code chunk that should show in the above slide looks like this

ggplot(data = park_visits_grouped) +
  aes(x = year) +
  labs(x = "the x label") +
  aes(y = visitors_per_year) +
  labs(y = "the y label") +
  scale_x_continuous() +
  geom_line() +
  geom_area(alpha=.3) +
  labs(col = "legend title") +
  labs(title = "My title") +
  theme_minimal()

r apply_reveal("national_parks_visitors")

What happens for me is I get the plot image first and then the code is below. Then I go to the next slide and it recreates the whole thing. I'm not sure if I am explaining this well.

I am using r 3.6.1-1 and rstudio 1.2.

EvaMaeRey commented 5 years ago

I think you need to add a '---' slide separator between your code chunk and apply_reveal() in line. Does that make sense? But, if you set the code chunk to eval = F you won't need the the slide separator. Also, be careful that you don't have any trailing spaces after the '---' because Xaringan won't interpret that as a separator if there is. Please let me know if this works.

novica commented 5 years ago

I was trying to follow the same code that was in the template but maybe I copied something wrong. I will try again for sure, but I got frustrated because it seems the Rstudio editor is behaving strangely when I am trying to do the slides.

I don't even know how to explain, but when typing whatever in the code chunk area it seems some of the text gets misplaced and then the .Rmd crashes.

By misplaced I mean I have a code chunk such as:

ggplot(data = my_data) +
  aes(x = var1) +
  labs(x = "the x label") +
  aes(y = var2) +
  labs(y = "the y label") +
  geom_point() +
  aes(col = var3) +
  labs(col = "legend title") +
  labs(title = "My title")

and want to change for example aes(x = var1) to aes(x = var3) and I type that but end up with a line that looks like aes(x = var1)3. And I am pretty sure I am typing correctly and nothing strange is going on with my keyboard.

This hasn't happened to me in any other .Rmd so far, and I don't know how to deal with this issue; wether it is a bug in Rstudio or something with Xaringan and the flipbook setup.

EvaMaeRey commented 5 years ago

I'd probably take a break, like you are doing, and restart RStudio when you are ready to come back to it. It sounds like a buggy RStudio issue as it is happening in editing the .Rmd. Good luck!

EvaMaeRey commented 5 years ago

Thanks for reporting on how it's going.

EvaMaeRey commented 5 years ago

The file has been modified so that it has the cars data as an example instead of gapminder. Thanks for the feedback.

novica commented 5 years ago

Awesome. Thank you @EvaMaeRey

EvaMaeRey commented 5 years ago

👍 Please feel free to alert me to any more issues!