Skip to content

Conversation

@emmaSkarstein
Copy link

The changes are made in order to allow users to enter data as tibbles as well as data frames.

In short, the problem is the fact that subsetting tibbles and data frames is different, so when you have a data frame df then df[,"colname"] will return a vector, but if you instead have a tibble tb, then tb[, "colname"] will return a tibble, not a vector! However, using instead df[["colname"]] and tb[["colname"]] will both give a vector, regardless of the object being a data frame or a tibble.

Originally I changed all cases of df[,"colname"] to df[["colname"]], but this seemed to cause an error, so I went back to only changing the subsetting where we check "is.logical(observs@data[,presname])". This means that the data frame subsetting is inconsistent throughout the function, though.

…o avoid problems when subsetting tibbles (without changing behavior for regular data frames).
Changed back subsetting all places except where we check class of observs@data[[presname]], as previous changes seemed to cause one error when running the tests. Now I think we will avoid the problems with tibbles, but this also means that the dataframe subsetting is inconsistent throughout the code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant