Please consider the following three examples:
library(tidyverse)
x_vector <- c("Device=iPhone", "Device=Samsung Galaxy")
x_df <- as.data.frame(c("Device=iPhone", "Device=Samsung Galaxy"))
x_tibble <- as_tibble(c("Device=iPhone", "Device=Samsung Galaxy"))
I now want to remove part of each string, i.e. the "Device=" sub string. It works for a vector, it also works for a data frame (if I specify the respective column), but I get a weird result for a tibble:
(the desired output would be the ones shown below for the vector and df example)
output_vector <- str_remove(x_vector, "Device=")
output_df <- str_remove(x_df[,1], "Device=")
output_tibble <- str_remove(x_tibble[,1], "Device=")
Can anyone please explain why this doesn't work with tibbles and how I can get it working with tibbles?
Thanks!