Dear Rolf,
I'll take a look how to fix it tomorrow, your proposal is very welocme,
of course,
Best,
Uwe
On 18.01.2016 00:01, Rolf Turner wrote:
On 18/01/16 10:48, Uwe Ligges wrote:
This is not a tab delimited file (as you apparently assume given the
code), but a fixed width format, hence I
A Big thanks to everyone to help me solve this problem .
My bad I assumed the file is delimited by tab which it was not . Its a
fixed width file and the code that Uwe gave is just perfect .
It was cleaver to skip the first row since the delimiter cannot be
specified in this case .I added few more t
On 18/01/16 10:48, Uwe Ligges wrote:
This is not a tab delimited file (as you apparently assume given the
code), but a fixed width format, hence I'd try:
url <- "http://data.princeton.edu/wws509/datasets/divorce.dat";
widths <- c(9, 13, 10, 8, 10, 6)
f5 <- read.fwf(url, widths = widths, skip = 1
This is not a tab delimited file (as you apparently assume given the
code), but a fixed width format, hence I'd try:
url <- "http://data.princeton.edu/wws509/datasets/divorce.dat";
widths <- c(9, 13, 10, 8, 10, 6)
f5 <- read.fwf(url, widths = widths, skip = 1, strip.white = TRUE)
names(f5) <- a
Hi Pradeep,
Any software would be challenged to determine the boundaries between your
columns.
ff <- 'http://data.princeton.edu/wws509/datasets/divorce.dat'
txt <- readLines(ff)
head(txt)
# [1] " idheduc heblack mixed years div " " 9
12-15 yearsNo N
Hello Pradeep
I downloaded divorce.dat but I could not find tabs between the columns.
You defined tab as separator, so your columns should be separated by tabs.
Therefore read.table reads the whole first line and wants to save the
result as numeric because you defined the first column as numeric
6 matches
Mail list logo