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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -