This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Note for Biostar moderators

Tried to write an R ifelse statement here, but the parenthesis between ifelse and is.na() would disappear in the final format. See below:

This is the preview of the code:

enter image description here

And this is the final outcome:

df$H1 <- ifelseis.na(df$H1), df$H2, df$H1)

Any thoughts?

r

By the way, the Gist solution is attractive when lots of code makes the post exceed the 5k character limit as the Gist content does not count for this.

1 answer

There are some known problems with code parsing (especially with parenthesis in specific instances, also with python code) and there is no immediate solution. You can host the code in a GitHub gist and link that here.

Biostars will be moving to a new codebase in next few months. These issues will no longer be there.

Some hints on how to link a gist, to a post? Not working with a simple inserting link address in the post.

Simply inserting a link (needs to be public gist) https:// gist.github.com/your_user_name/random_number should be enough. Biostars code will render it automatically.

Log in to answer this question.