Difference between () & [] in R -


i write this:

tempx <- tempx (-1, c(-4, -2:-20)) 

which gives error message as: could not find function "tempx" whereas

tempx <- tempx [-1, c(-4, -2:-20)] runs properly. 

please let me know diff between () & [].

() used call function. [] used subsetting vectors, arrays , matrices (and other such objects).

i'd suggest if haven't already, reading an introduction r, available typing help.start() r itself. in particular, might @ sections 2.1 vectors , assignment , 5.2 array indexing. subsections of array.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -