I have the following datafraame column:
df$HtmlString <- lapply(df$HtmlCode, set_lists_to_chars)
set_lists_to_chars <- function(x) {
if(!is.null(x)) {
y <- paste(unlist(x), sep='', collapse=' NEWELEMENT ')
} else {
y <- x
}
return(y)
}
The elements of the column HtmlString are obviously made of characters, because when I print type of any its element, I get "character"
typeof(df$HtmlString[[11]])
'character'
But whenever I look at the type of the column in the dataframe, I get 'list' type:
glimpse(df)
Why does this happen?