I am trying to perform a simple task: Remove rows from my data frame that have a value of 0 in a column titled "complete". A working example is below, but the dataset I am working with is VERY large.
# Creating a sample data frame
data <- data.frame(
id = c(1, 2, 3, 4, 5),
name = c("John", "Jane", "David", "Michael", "Emily"),
age = c(25, 30, 35, 40, 45)
)
# Removing rows with the name "David"
data_filtered <- data[data$age != 30, ]
# Printing the resulting data frame
print(data_filtered)
It works when I run the above code, but when I try to do the same thing with my own data, I am getting the error message below. My data is called "prepost.reccee.data" and I want to keep rows where the column "complete" != 0.
Error in vec_equal()
:
! Can't combine ..1
<haven_labelled> and ..2
.
Backtrace:
** 1. prepost.reccee.data[prepost.reccee.data$complete != 0, ]**
** 3. vctrs:::!=.vctrs_vctr
(prepost.reccee.data$complete, 0)**
** 4. vctrs::vec_equal(e1, e2)**
Thank you for any help!