Skip to content
Prev 389097 / 398506 Next

'Double to logical' error

Thank you Duncan

we now resolved this

However I have run into another problem with the section of script below- I am getting in reply

Error in nchar(a) : invalid multibyte string, element 1

Thanks




SCRIPT SECTION:


# fill data frame with meta results
j=1
for (indiv_meta in to_include){
  graph_results$estimate[j]=results_list[[indiv_meta]]$b
  graph_results$lb[j]=results_list[[indiv_meta]]$ci.lb
  graph_results$ub[j]=results_list[[indiv_meta]]$ci.ub
  graph_results$p[j]=results_list[[indiv_meta]]$pval
  a <- as.character(results_list[[indiv_meta]]$slab)
  #this reduces the 'k' printed on the graph for instancews where sibsamples counted as sepearte studies
  b <- substr( a, start = nchar(a) - 1 , stop = nchar(a)-1)
  num_dups = sum(b==".")/2
  graph_results$k[j]=as.integer(results_list[[indiv_meta]]$k)-num_dups
  j=j+1
}