r - Combining value 'A' to 'B' to form one value as C -


i'm working in r , wanted combine values follows:

i have 2 variables i've created,

a = c(1,2,3) b = c(4,5,6) 

and make new value 'c' have output:

c   [1] 1 2 3 4 5 6 

my question how 1 in r? many in advance!

here easiest way it

a = c(1,2,3) b = c(4,5,6)  c <- c(a,b)  c 

even though unnecessary, write function you

function_to_combine_vectors <- function(vector_1, vector_2){ new_vector <- c(vector_1, vector_2) return(new_vector) } c <- function_to_combine_vectors(a, b) print(c) 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -