I am looking to filter a data frame based on two criteria: 1. few key variables and, 2. Several other variables with a specific pattern.
Usually I use the following code:
mydata <- rawData[,c("scenario","period","farmID",grep("planting_*",names(rawData), value = TRUE))]
The problem is happening after I updated R to the new version (3.5.3). Before it worked fine and I got what I wanted: a new data frame filtered by variables.
However, now R is returning a vector only with the variable names (with no observation).
Could anyone help me with this issue?