Replace the vector, A, b with a string, where:
A=c (1,2,3,4)
b=c (2,3,4,5)
In order to convert it into a string can be achieved by introducing the package Stringr, using the Str_c implementation, using paste also can achieve the purpose, as follows:
Library (Stringr)
a_b=str_c (a,b,collapse= ")
paste (a,b,sep=")
The output is:
[1] "12233445"
In the actual data processing can be used to build a federated index, such as the data frame needed to join the index column into a column, it can be more convenient in practice, to avoid a lot of trouble, but it is important to note that at the end of each column with a character such as a null character to ensure one by one mapping. For example, the data for the first two rows of the data frame are:
A1 A2 A3 A4
1 1 1 4
2 1 each 1 5
If you use the first three columns, the index is A1,A2,A3. If you do not add a special word, the Fu Zeti line and the second line are concatenated with the following characters:
[1] "1111"
The indexes are the same, so you need to add special characters to avoid this, such as after joining a space after two lines of data are connected:
[1] "1 1"
[2] "1 11 1"
These two strings are not the same.