'Read .csv file in R
I am a beginner to R, I have a file like below.
state population
Alabama 4779736
Alaska 710231
Arizona 6392017
Delaware 897934
District of Columbia 601723
I saved it in notepad as "tab1.csv"
, then I use read_csv
to read in R with
tab1 <- read_csv("tab1.csv")
tab1
and the data after read like this:
tab1
# A tibble: 5 x 1
`state \t population`
<chr>
1 "Alabama 4779736"
2 "Alaska \t 710231"
3 "Arizona \t 6392017"
4 "Delaware \t 897934"
5 "District of Columbia 601723"
My question is what "\t"
mean and how to read this data and I hope I can get exact as input.
Thank you very much.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|