Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Comparing two vectors and arrange one elements of vector with respect other vector if not in same order

$
0
0

@revathi wrote:

i have vector like this
new_vect
[1] "b" "d" "c" "e" "h" "f" "g"

and i have data frame like
b d
b c f g h
b c d e f h
c e g h
d
b
d e

now i want to compare each row of dataframe with new_vect, and arrange the elements of row in dataframe as like in new_vect

for ex
in 2nd row of dataframe i have " b c f g h" these should arrange like "b c h f g"

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles