0
Я хотел бы знать способ Подменит с [], сохраняющим порядок запросов (авторы), например:Подменят (выполнение запроса) dataframe сохранения порядка в R
authors<-c("Almeda","Acosta", "Moscone", "Guerra")
authorcountry <- read.table(text="
authoralone countryalone
1 Acosta Argentina
2 Aguilera Argentina
3 Almeda U.S.A
4 Alves Brazil
5 Araújo Brazil
6 Bernardello Argentina
7 Daviña Argentina
8 Guerra Brazil
9 Honfi Argentina
10 Moscone Argentina",header=TRUE,fill=TRUE,stringsAsFactors=FALSE)
authorcountry$countryalone[(authorcountry$authoralone %in% authors)]
#order should be:
# [1] "U.S.A" "Argentina" "Argentina" "Brazil"
#as in:
authors<-data.frame(authors)
get_merge<-merge(authors,authorcountry, by.x="authors", by.y="authoralone", sort = FALSE)
get_merge$countryalone