Closed Krgaric closed 1 year ago
All previous comments resolved. There is still an issue with autoplot function in dna_backbone. Here is the error log:
Error in
ggplot2::geom_line(): ! Problem while computing aesthetics. ℹ Error occurred in the 1st layer. Caused by error: ! Can't subset
.dataoutside of a data mask context. Run
rlang::last_trace()` to see where the error occurred.
rlang::last_trace() <error/rlang_error> Error in
ggplot2::geom_line()
: ! Problem while computing aesthetics. ℹ Error occurred in the 1st layer. Caused by error: ! Can't subset.data
outside of a data mask context.Backtrace: ▆
- ├─base (local)
<fn>
(x)- ├─ggplot2:::print.ggplot(x)
- │ ├─ggplot2::ggplot_build(x)
- │ └─ggplot2:::ggplot_build.ggplot(x)
- │ └─ggplot2:::by_layer(...)
- │ ├─rlang::try_fetch(...)
- │ │ ├─base::tryCatch(...)
- │ │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
- │ │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
- │ │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
- │ │ └─base::withCallingHandlers(...)
- │ └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
- │ └─l$compute_aesthetics(d, plot)
- │ └─ggplot2 (local) compute_aesthetics(..., self = self)
- │ └─ggplot2:::scales_add_defaults(...)
- │ └─base::lapply(aesthetics[new_aesthetics], eval_tidy, data = data)
- │ └─rlang (local) FUN(X[[i]], ...)
- ├─rlang::.data[["iteration"]]
- └─rlang:::
[[.rlang_fake_data_pronoun
(rlang::.data, "iteration")- └─rlang:::stop_fake_data_subset(call)
- └─rlang::abort(...)
The error occurs somewhere between lines 2851 and 2956. I checked all the geom_lines where "iteration" appears but cannot find anything odd.
Thanks. I hope you can figure it out. Let me tag @TimHenrichsen . Tim, can you help? Kristijan fixed the aes_string
problem, but there is some issue with the backbone autoplot code.
Hi Kristijan and thanks for all the work! I could reproduce your issue and noticed that I also couldn't compute other autoplot functions. I checked the .data
help file which says the following:
The .data pronoun is automatically created for you by data-masking functions using the tidy eval framework. You don't need to import rlang::.data or use library(rlang) to work with this pronoun.
However, the .data object exported from rlang is useful to import in your package namespace to avoid a R CMD check note when referring to objects from the data mask. R does not have any way of knowing about the presence or absence of .data in a particular scope so you need to import it explicitly or equivalently declare it with utils::globalVariables(".data").
Note that rlang::.data is a "fake" pronoun. Do not refer to rlang::.data with the rlang:: qualifier in data masking code. Use the unqualified .data symbol that is automatically put in scope by data-masking functions.
Could you test if the autoplot functions work, when you remove rlang::
before every .data
command?
Hi Kristijan and thanks for all the work! I could reproduce your issue and noticed that I also couldn't compute other autoplot functions. I checked the
.data
help file which says the following:The .data pronoun is automatically created for you by data-masking functions using the tidy eval framework. You don't need to import rlang::.data or use library(rlang) to work with this pronoun.
However, the .data object exported from rlang is useful to import in your package namespace to avoid a R CMD check note when referring to objects from the data mask. R does not have any way of knowing about the presence or absence of .data in a particular scope so you need to import it explicitly or equivalently declare it with utils::globalVariables(".data").
Note that rlang::.data is a "fake" pronoun. Do not refer to rlang::.data with the rlang:: qualifier in data masking code. Use the unqualified .data symbol that is automatically put in scope by data-masking functions.
Could you test if the autoplot functions work, when you remove
rlang::
before every.data
command?
Dear @TimHenrichsen, thank you, it works now. It plots as supposed, but there are some warning messages that should be checked out:
Warning messages:
1: Removed 499 rows containing missing values (geom_line()
).
2: Removed 998 rows containing missing values (geom_line()
).
3: Removed 499 rows containing missing values (geom_line()
).
use the gridExtra package to arrange the diagnostics in a single plot
library("gridExtra") grid.arrange(p[[1]], p[[2]], p[[3]], p[[4]]) Don't know how to automatically pick scale for object of type
. Defaulting to continuous. Don't know how to automatically pick scale for object of type . Defaulting to continuous. Warning messages: 1: Removed 499 rows containing missing values ( geom_line()
). 2: Removed 998 rows containing missing values (geom_line()
). 3: Removed 499 rows containing missing values (geom_line()
).
This was ran on the sample example. Is something like that expected?
Thank you for the help so far!
The checks below say that you need to put rlang
in the DESCRIPTION file under Imports.
The checks below say that you need to put
rlang
in the DESCRIPTION file under Imports.
Resolved.
You forgot the comma in the line before. See new errors in the check log below.
Let's try to wrap this PR up soon. Did you want to add anything else regarding
aes_string
or backbone plotting? Can you make the requested changes? Thanks.