0

I had 2 csv files, first csv file has 16749 rows,with SYMBOLS and log as a columns. In the first csv it contains some junk data, which is not needed at all. Second, is a clean csv file (no LOC11*) has 14107 rows, with SYMBOLS as only one column. I'd like to add for each SYMBOL ID it should find the corresponding logFC value from the first csv file. I'm breaking my head, newbie to programming, unable to do it. Some help please.

Example:
First csv
SYMBOL          log
LOC117745510   -0.35
LOC117741824   -0.54
ipmkb          -0.46
prrc2b

Second csv (log column to be added from 1st csv as reference)
SYMBOL          log
hs6st1a
ipmkb
prrc2b
park
  • 49
  • 6

1 Answers1

0

Read in your data with an appropriate import function like read.csv and then join it.

library(dplyr)

## read your files (possibly you need to adjust some arguments in read.csv)
file1 <- read.csv("path/to/file1.csv", header = TRUE)
file2 <- read.csv("path/to/file2.csv", header = TRUE)

file2 %>%
  left_join(file1, by = "SYMBOL)
eastclintw00d
  • 2,250
  • 1
  • 9
  • 18