Question: Note for Biostar moderators
0
gravatar for Hamid Ghaedi
3 days ago by
Hamid Ghaedi450
Canada
Hamid Ghaedi450 wrote:

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 • 90 views
ADD COMMENTlink modified 3 days ago by genomax91k • written 3 days ago by Hamid Ghaedi450

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 REPLYlink written 3 days ago by ATpoint40k
3
gravatar for genomax
3 days ago by
genomax91k
United States
genomax91k wrote:

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 COMMENTlink modified 3 days ago • written 3 days ago by genomax91k

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

ADD REPLYlink written 3 days ago by Hamid Ghaedi450
1

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 REPLYlink modified 3 days ago • written 3 days ago by genomax91k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1776 users visited in the last hour