tricky things in R

 ________________________________________________________________
/  ____    _                                                     \
| |  _ \  (_)___    __ ___      _____  ___  ___  _ __ ___   ___  |
| | |_) | | / __|  / _` \ \ /\ / / _ \/ __|/ _ \| '_ ` _ \ / _ \ |
| |  _ <  | \__ \ | (_| |\ V  V /  __/\__ \ (_) | | | | | |  __/ |
| |_| \_\ |_|___/  \__,_| \_/\_/ \___||___/\___/|_| |_| |_|\___| |
\                                                                /
 ----------------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
  1. 赋值

从一开始学R就知道R的赋值符号和别的语言不一样,用的是<-,虽然=也用,很多书会告诉你两者是一样的,完全通用,不过用R的人习惯也推倡用<-。所以我基本上就抛弃用=号了,反正在ESS里用shift+-就会自动输入<-,也是很方便的。直到有一天,我发现在switch里,必须用=,而不能用<-,才发现坑爹啊,这两符号是不一样的。

Continue reading

when I recalled the switch function, it always gave the first element, no matter what the parameter is.

r-29-dev

when organism changed to “yeast”, and called switch function, species supposed to be changed to “Sc”, but it remains it’s original value.

Continue reading

Author's picture

Guangchuang Yu

Bioinformatics Professor @ SMU

Bioinformatics Professor

Guangzhou