Note for Biostar moderators
1
0
Entering edit mode
3.5 years ago

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 • 567 views
ADD COMMENT
0
Entering edit mode

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.

ADD REPLY
3
Entering edit mode
3.5 years ago
GenoMax 141k

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.

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 2330 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6