-1

I have a tibble that has a column of type double, confirmed with type of, containing 0's and 1's. I need to turn these 0's and 1's into true or false

my_tibble$column_to_convert <- as.logical(my_tibble$column_to_convert)

has not worked. The values still display as NA

Jay Wehrman
  • 193
  • 2
  • 10

1 Answers1

0

If you see this error:

Error: (list) object cannot be coerced to type 'logical'

Try this:

my_tibble$column_to_convert <- as.logical(unlist(my_tibble$column_to_convert))
webb
  • 4,180
  • 1
  • 17
  • 26