I have a question concerning outputting numbers inline in a R notebook. I wanted to switch to a more readable code using dplyr and pipes, but now the numbers I would like to compute are no longer shown in line with the text.
So far, I wrote my code like this:
Number of dogs: `r nrow(animals[which(animals$species == "dog"),])`!
And I got the numbers inline:
Number of dogs: 8!
If I switch to
Number of dogs: `r animals %>% filter(species == "dog") %>% count()`!
The output is no longer inline, but inserted in the line below, with a box around it:
Number of dogs:
[ n]
[ <int>]
[ 90]
[1 row ]
!
How do I get the inline output back?