Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Data Science
  3. Question
Data Science

The 'list' object cannot be coerced to type 'double' in R shiny

Asked by Guy Rodd Apr 19, 2021 2.2K views 1 answer
Share

About this question

When I run the following code in R then I am not getting any error, but if I run the same code in R shiny, then I am getting the following error:

error 'list' "object cannot be coerced to type 'double' "

In the code, the f2 is the file that is being uploaded by the user, and that file contains only 1 column and multiple rows with 1 word each.

s = vector("list", 1)

#the loop below runs over the length of no of genes all written in different rows

for (i in 1:length(f2[,1])) { s[i] = list({ y = lapply(1:6, function(x) apc[[x]]$Log₂ fold change[apc[[x]]$Name== f2[i,1]] ) unlist(as.numeric(y))
}) }

Your answer

1 Answer

More Data Science discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.