My test shows content as below"
"ID" "Prob"
0 10000
1 8778.9828374645
2 8694.77448972435
I tried to skip the first row so that my content are pure numbers and give them column names instead
data <-
read.fwf("mydata.txt",
skip = 1,
widths= c(18),
col.names=c("ID", "Prob"),
strip.white=TRUE
)
However, the results looks like this (it automatically scientific notation & reserve decimal)
ID Prob
0 1.000000e+04
1 8778.982e+03
Then I tried not skip the first row and still give them a row name. The number value is good, but there is an extra row of "ID & Prob"
data <-
read.fwf("mydata.txt",
widths= c(18),
col.names=c("ID", "Prob"),
strip.white=TRUE
)
It looks like
ID Prob
"ID" "Prob"
0 10000
1 8778.9828374645
How can I make my load data shows exactly the same as my original text data? (Do not use scientific notation and do not reserve decimal) (Also my data is just column name and pure numbers )