I'm trying to import the following text file:
"year" "sex" "name" "n" "prop"
"1" 1880 "F" "Mary" 7065 0.0723835869064085
"2" 1880 "F" "Anna" 2604 0.0266789611187951
"3" 1880 "F" "Emma" 2003 0.0205214896777829
"4" 1880 "F" "Elizabeth" 1939 0.0198657855642641
"5" 1880 "F" "Minnie" 1746 0.0178884278469341
"6" 1880 "F" "Margaret" 1578 0.0161672045489473
"7" 1880 "F" "Ida" 1472 0.0150811946109318
"8" 1880 "F" "Alice" 1414 0.0144869627580554
"9" 1880 "F" "Bertha" 1320 0.0135238973413247
"10"1880 "F" "Sarah" 1288 0.0131960452845653
and I don't have any problems using:
data <-read.table("~/Documents/baby_names.txt",header=TRUE,se="\t")
However, I haven't figured out how to do it with readr. The following command fails:
data2 <-read_tsv("~/Documents/baby_names.txt")
I know the problem is related to the fact that the first row contains five elements (the headings) and the rest 6 but I don't know how to tell readr to ignore the "1", "2", "3" and so on. Any suggestions?