I have to datasets from these links: cmu: http://lib.stat.cmu.edu/S/Harrell/data/descriptions/titanic.html kaggle: https://www.kaggle.com/c/titanic-gettingStarted/data
When I try to merge them, my columns to the right repeat, any way I can fix this? I am trying to compare the "Fare" to the people. Mostly trying to learn merge.
cmu <- read.csv("titanic_cmu.txt")
kaggle <- read.csv("titanic_kaggle.csv")
tdata <- merge(cmu, kaggle)
output:
> head(tdata)
row.names pclass survived name age embarked home.dest room ticket boat sex
1 1 1st 1 Allen, Miss Elisabeth Walton 29.0000 Southampton St Louis, MO B-5 24160 L221 2 female
2 2 1st 0 Allison, Miss Helen Loraine 2.0000 Southampton Montreal, PQ / Chesterville, ON C26 female
3 3 1st 0 Allison, Mr Hudson Joshua Creighton 30.0000 Southampton Montreal, PQ / Chesterville, ON C26 (135) male
4 4 1st 0 Allison, Mrs Hudson J.C. (Bessie Waldo Daniels) 25.0000 Southampton Montreal, PQ / Chesterville, ON C26 female
5 5 1st 1 Allison, Master Hudson Trevor 0.9167 Southampton Montreal, PQ / Chesterville, ON C22 11 male
6 6 1st 1 Anderson, Mr Harry 47.0000 Southampton New York, NY E-12 3 male
PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked
1 1 0 3 Braund, Mr. Owen Harris male 22 1 0 A/5 21171 7.25 S
2 1 0 3 Braund, Mr. Owen Harris male 22 1 0 A/5 21171 7.25 S
3 1 0 3 Braund, Mr. Owen Harris male 22 1 0 A/5 21171 7.25 S
4 1 0 3 Braund, Mr. Owen Harris male 22 1 0 A/5 21171 7.25 S
5 1 0 3 Braund, Mr. Owen Harris male 22 1 0 A/5 21171 7.25 S
6 1 0 3 Braund, Mr. Owen Harris male 22 1 0 A/5 21171 7.25 S