Home Forums R Programming Talks How to combine values into vector in R?

Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by  blogger rajeev 6 months, 3 weeks ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #842

    blogger rajeev
    Keymaster

    c {base}
    Combine Values into a Vector or List
    Description
    This is a generic function which combines its arguments.

    The default method combines its arguments to form a vector. All arguments are coerced to a common type which is the type of the returned value, and all attributes except names are removed.

    The Better example is here:-(Via r-tutor.com)

    Combining Vectors
    Vectors can be combined via the function c. For examples, the following two vectors n and s are combined into a new vector containing elements from both vectors.

    > n = c(2, 3, 5)
    > s = c(“aa”, “bb”, “cc”, “dd”, “ee”)
    > c(n, s)
    [1] “2” “3” “5” “aa” “bb” “cc” “dd” “ee”

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.