Appending vector creating two separate lists in R

42 views Asked by At

I am new in R and I am quite confused about the data structure. I am dealing with two vectors, each vector containing strings of character as below:

vector1: enter image description here

vector2: enter image description here

And in order to append these vectors, I used the append function as follows: text_append <- append(vector1, vector2)

But, once I append it, it creates two separate lists, whereas I wanted it to become just 1 list enter image description here

How can I make sure that I make 1 whole list of strings? I am compiling the strings, and making them as separate list wont help. I dont know what else to do.

Thanks for the help

I tried to use the append function

text_append <- append(vector1, vector2)

I expected it to retrieve me a single list of strings, but instead it gives me two separate lists.

1

There are 1 answers

1
ReelSaemon On

When concatenating two vectors of strings just use c(vector1, vector2). If you want to make a list with the elements being made of the strings use as.list(c(vector1, vector2))