r - Why is ifelse generating print output? -



r - Why is ifelse generating print output? -

i have code in rmarkdown file knit:

ifelse(sys.info()[1]=="linux", wdir <- "/path/1", wdir <- "/path/2") setwd(wdir)

except it's supposed silent. i've got in block

```{r prepare.data,echo=f,warning=false,message=false,error=false}

i don't want generate output that, yet when knit, in output:

## sysname ## "/path/1"

i've tried code snip in console , generating print output.

my questions are: 1. why ifelse printing output? 2. how can avoid it?

thanks!

try wdir <- ifelse(sys.info()[1]=="linux", "/path/1", "/path/2"). reason output printed if don't assign ifelse output variable, print on screen. writing a <- 1 + 2 vs 1 + 2.

r if-statement

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -