I am using tis package for a while which is one of my main source for depicting the recession bar in ggplot2. I recently encounter an error in my system while I have been using that. I am not sure it related to updating the some packages or R studio or in my code. I tested the example in package's PDF manual and I got same result. This the code and the related error message that I get:
Error: Summary operations are not defined for quosures.
Do you need to unquote the quosure?
Bad:
range(myquosure)
Good:
range(!!myquosure)
Call rlang::last_error() to see a backtrace
i do not know what is the error . I would appreciate any advise.
This code is not actually reproducible, since we don't have access to economics dataset, please provide some sample data whit your reprex, if you don't know how, here is a blog post by Mara that explains how to do it.
Hi,
this is the first time i am using reprex. i try to provide the correct info.
library(tis)
ggp <- ggplot(aes(x=date, y=100*unemploy/pop), data=economics)
#> Error in ggplot(aes(x = date, y = 100 * unemploy/pop), data = economics): could not find function "ggplot"
nberShade( ggp ) + xlim(as.Date("1967-01-01"), Sys.Date()) +
opts(legend.position="none") + geom_line() + theme_bw()
#> Error in nberShade(ggp): object 'ggp' not found
I was referring to the code that creates your sample data (the one that is showed in the screen shot you posted before) , the idea is that you have to include all the code needed to reproduce your example, including data and library calls.
I use sample data from tis package. i could run this example from tis package manual. i could run before. but now i am not able to run this code to make recession bar in ggplot. tis package has a function nberShade(). when ggolot object created, this function mades recession bar on ggplot. i am not sure this dataset is part of Rstudio or tis package.
I truly appreciate your help and time. Thank you very much.
Ok, I see, economics dataset comes with ggplot2 (you forgot the library call to ggplot2)
library(ggplot2)
library(tis)
ggp <- ggplot(aes(x=date, y=100*unemploy/pop), data=economics)
nberShade(ggp) + xlim(as.Date("1967-01-01"), Sys.Date()) +
opts(legend.position="none") + geom_line() + theme_bw()
#> Error: Summary operations are not defined for quosures.
#> Do you need to unquote the quosure?
#>
#> # Bad:
#> range(myquosure)
#>
#> # Good:
#> range(!!myquosure)
Sadly tis is no longer compatible with the current version of ggplot2 because it doesn't makes correct use of tidy evaluation, and aparently is no longer under active development and doesn't has an issues page.
This is the mirror repository on github https://github.com/cran/tis, you could fork it and try to fix it to make it work with the latest ggplot2 version.