-
Error descriptionHi, I just started learning about I wrote a test function in In a separate file, I called the function using box: In But if I call R version‘box’ version1.1.2 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
|
With ‘box’, the contents of different modules are strictly isolated from each other. So if you have a module In your case, this means that you need to move the relevant box::use(dplyr[...])
test <- function(dat) {
dat %>%
filter(x == 3)
}(Note that I also removed the last line of your And in your other code that uses box::use(R/test[test]) |
Beta Was this translation helpful? Give feedback.
With ‘box’, the contents of different modules are strictly isolated from each other.
So if you have a module
test.Rthat needs the%>%operator or thefilterfunction (or any other function), you need to import those names inside that module. You can’t put the code for the import into a separate file.In your case, this means that you need to move the relevant
box::use()declaration intotest.R:(Note that I also removed the last line of your
testfunction, since you returned the unmodifieddat, which was probably not intended.)And in your other code that uses
test.R, you no longer need to import ‘dplyr’ (unles…