hello,

I am hoping for some advice regarding comparing variables from 3 versions of a spreadsheet which have been combined into a single dataframe. The aim is to identify which rows have been changed.

The dataframe contains 177 rows of data (each cell contains text). 'intersect' produced a file with 35 rows, 'union' a file with 303 rows and 'setdiff' a file with 130 rows
Below is the code that I have started with.

Ideally I would like to identify the actual row numbers where there is difference in the variables (either pairwise or between 3 variables).


x <- read.csv("c://rec_compare.csv",header=T, as.is=TRUE)

u <- union(x$rm1, x$redc1)
write.csv(u,"c:/union_test.csv")

i <- intersect(x$rm1, x$redc1)
write.csv(i,"c:/intersect_test.csv")

sd <- setdiff(x$rm1, x$redc1)
write.csv(sd,"c:/setdiff_test.csv")

Any suggestions are appreciated.

regards

Bob

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to