0

Can someone help me revise my existing formula to look for rows in FileA based on row value in fileB, which should be non case-sensitive. I have this formula for now: For (num in 1:nrow(dic)){

row1=which(FileA$'Position' == FileB$'Position)'[num])
row2=which(FileA$'Job Title' ==FileB$'Job Title'[num])
row= intersect (row1, row2)

So the result should return me all the rows found in FileA based on the content of row in FileB, non case sensitive.

zx8754
  • 52,746
  • 12
  • 114
  • 209
Eyyy
  • 129
  • 1
  • 1
  • 6
  • 1
    Read about merge: https://stackoverflow.com/questions/1299871/how-to-join-merge-data-frames-inner-outer-left-right – zx8754 Jan 05 '21 at 11:10
  • I am looking for formula not for joining but for capturing the rows non case-sensitive based on the content of the row – Eyyy Jan 05 '21 at 11:12

1 Answers1

0

Something like this:

v1 <- c("Horse","Cat","Dog")
v2 <- c("Bird","horse","giraffe","dog")
intersect(tolower(v1),tolower(v2))
#[1] "horse" "dog"
Andre Wildberg
  • 12,344
  • 3
  • 12
  • 29