मैं एक मेज है कि इस प्रकार दिखता है:आर: एक और तालिका से डेटा के साथ तालिका में कॉलम जोड़ें
Table1 <- data.frame(
"Random" = c("A", "B", "C"),
"Genes" = c("Apple", "Candy", "Toothpaste"),
"Extra" = c("Up", "", "Down"),
"Desc" = c("Healthy,Red,Fruit", "Sweet,Cavities,Sugar,Fruity", "Minty,Dentist")
)
दे रही है:
Random Genes Extra Desc
1 A Apple Up Healthy,Red,Fruit
2 B Candy Sweet,Cavities,Sugar,Fruity
3 C Toothpaste Down Minty,Dentist
मैं विवरण के साथ एक और टेबल है और एक जोड़ना चाहते हैं जीन के साथ कॉलम। उदाहरण के लिए तालिका 2 होगा:
Table2 <- data.frame(
"Col1" = c(1, 2, 3, 4, 5, 6),
"Desc" = c("Sweet", "Sugar", "Dentist", "Red", "Fruit", "Fruity")
)
देता है:
Col1 Desc
1 1 Sweet
2 2 Sugar
3 3 Dentist
4 4 Red
5 5 Fruit
6 6 Fruity
मैं "जीन" नाम तालिका 2 के लिए एक और स्तंभ है कि दोनों तालिकाओं से "वर्णन" से मेल खाता है और करने के लिए Table1 से जीन कहते हैं जोड़ना चाहते हैं मिलती है:
Col1 Desc Gene
1 1 Sweet Candy
2 2 Sugar Candy
3 3 Dentist Toothpaste
4 4 Red Apple
5 5 Fruit Apple
6 6 Fruity Candy
मैं 'Gene' के लिए' Toothpaste' के मूल्य पर एक अच्छा हंसी थी। –