r - How to use rowwise with do function with if else of ifelse? -
i have data frame contain column, list.
data frame contain json reponse column, , second column list converted json using following code.
vectorize_fromjson <- vectorize(fromjson, use.names=false) z <- vectorize_fromjson(data_df$json_response)
i using rowwise function extract information list.
however, not able use if it.
working code
t <- data_df %>% rowwise %>% do( test = class(.$json_list$cbas$dslscc) )
i want follows:
t <- data_df %>% rowwise %>% do( test = ifelse(class(.$json_list$cbas$dslscc)=="list", true, .$json_list$cbas$dslscc) )
following error:
error in .$json_list$clear_bank_attributes$days_since_last_successful_check_cashed$nil : $ operator invalid atomic vectors
Comments
Post a Comment