search for: fwf

Displaying 20 results from an estimated 164 matches for "fwf".

Did you mean: fw
2012 Sep 14
1
Any way to get read.table.ffdf() (in the ff package) to pass colClasses or comment.char parameters through to read.fwf() ?
Hi everyone, my apologies if I'm overlooking something obvious in the documentation. I'm relatively inexperienced with the (awesome) ff package. My goal is to use the read.table.ffdf() function to call the read.fwf() function and pass through the colClasses and comment.char arguments. The code below shows exactly what doesn't work for me. If the colClasses and comment.char parameters cannot be passed to read.fwf() through read.table.ffdf(), I'd love to hear any ideas for a workaround? :) Passing t...
2009 Feb 24
0
data file - function write.fwf - library gdata
...with thousands of lines (cases), where each line contains the values of several variables. I would like to separate these lines in small groups, with each group followed by a blank line, to ease the visual inspection of the data in some situations. I am writing the output files with function write.fwf in library gdata, for correct column alignment. Below is a small-scale example, which requires library gdata. The results are shown just below the code. In the example, output file 1 gives the correct result I am looking for. But the real production code should be, I think, something like the one...
2006 Sep 26
0
Wish: change behaviour of header in read.fwf (PR#9252)
Hello! In my opinion read.fwf()'s behaviour of header is not really useful. Say I have the following data: col1 col2 col3 123 123 123 a b 1234 12 1234 65.4 4.5 Now if I want to read this data into R I can not use read.table due to missing fields. read.table(file="test.txt") Error...
2004 Nov 08
1
Possible bug in read.fwf (PR#7350)
Full_Name: Shigeru Mase Version: R 1.9.1 and 2.0.0 OS: Debian Linux Submission from: (NULL) (219.35.150.115) I tried to read the following text file "test.txt" with 5 lines using read.fwf() function: # comment 1 1234567 # comment 2 1 234567 # comment 3 12345 67 # comment 4 # comment 5 In R 1.9.1, I got the following result (since I have R 2.0.0 installed now I cannot reproduce it now but, at least, my former record says so): > (x <- read.fwf("test.txt", width...
2002 May 03
3
skipping columns with read.fwf?
I have a file in fwf. It is rather large, about 40,000 rows and 40 variables (columns). I only need about 10 variables form the data set for the analysis at hand. Unfortunately, these 10 variables are not contiguous in the file, for example, the first is position 1-8, the next position 25-27, then 40. Is there a wa...
2009 Apr 14
2
Controlling widths in write.fwf()
Is there a way to handle the widths of values being written to a file using wrtite.fwf() ? For example, I used read.fwf(file, width.vector) to read a file. After making the necessary data manipulation, I want to write the data to a new file in the same width.vector format. Is there a way to specify this? Thanks in Advance Aparna [[alternative HTML version deleted]]
2004 Jul 10
1
read.table, read.fwf, and na.strings (PR#7075)
...ault on Windows), # hence we cannot send the bug report directly from R. # Please copy the bug report (after finishing it) to # your favorite email program and send it to # # r-bugs@r-project.org # ###################################################### Is this intended behavior for the read.fwf(na.strings="-999")? I anticipated that the na.strings would be padded with blanks. Therefore I anticipated getting the result tmp2 from the simpler na.strings in the tmp1 assignment? My anticipation is based on the documentation that says "Blank fields are also considered to be miss...
2005 Oct 20
4
read.fwf doesn't work with header = TRUE (PR#8226)
Full_Name: Emmanuel Paradis Version: 2.1.1 OS: Linux Submission from: (NULL) (193.49.41.105) read.fwf(..., header = TRUE) does not work properly since: 1/ the original header is printed on the console and not in FILE; 2/ the different 'parts' of the header should be separated with tabs to work with the call to read.table. Here is a suggested fix for src/library/utils/R/read.fwf.R: 38c...
2002 Dec 12
1
Read FWF, problem and solution?
Running R 1.6.1 Linux Slackware 8.1 233MHZ AMD-K6 96MB RAM Using read.fwf, I tried to open a fixed-width file that of about 4 MB residing in the working directory, using the command below: dat<-read.fwf("sc01aai.dat", widths=fields$length) where fields$lengths is a vector of column widths, 28 to be exact. The data are a mix of character, text, and facto...
2006 Oct 30
4
read.fwf and header
...919684.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 968214.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 1232076.4 8 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 1141273.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 5.5 988481.4 10 j q 1900-01-01 1900-01-01 01:01:01 This is a FWF (fixed width format) file. I can not use read.table here, because of missing values. I have tried with the following > read.fwf(file="test.txt", widths=c(3, 4, 10, 3, 2, 2, 2, 2, 11, 20), header=TRUE) Error in read.table(file = FILE, header = header, sep = sep, as.is = as.is, : mor...
2006 Oct 30
4
read.fwf and header
...919684.4 6 f l w u 1900-01-01 1900-01-01 01:01:01 8 4.0 968214.6 7 g m x t 1900-01-01 1900-01-01 01:01:01 9 4.5 1232076.4 8 h n y s 1900-01-01 1900-01-01 01:01:01 10 5.0 1141273.4 9 i o z r 1900-01-01 1900-01-01 01:01:01 5.5 988481.4 10 j q 1900-01-01 1900-01-01 01:01:01 This is a FWF (fixed width format) file. I can not use read.table here, because of missing values. I have tried with the following > read.fwf(file="test.txt", widths=c(3, 4, 10, 3, 2, 2, 2, 2, 11, 20), header=TRUE) Error in read.table(file = FILE, header = header, sep = sep, as.is = as.is, : mor...
2002 Feb 01
0
comment.char in read.fwf (PR#1297)
Full_Name: Jeffrey Longmate Version: Version 1.4.0 Patched (2002-01-23) OS: Windows NT 4.0 Submission from: (NULL) (151.152.101.44) In read.fwf, ... args are passed to read.table, as stated in the documentation. However, passing comment.char in this manner is defeated by the call to scan that precedes the call to read.table. The problem is that scan has a default comment.char="#", and read.fwf doesn't pass ... to scan. A s...
2002 Feb 01
0
comment.char in read.fwf (PR#1298)
Full_Name: Jeffrey Longmate Version: Version 1.4.0 Patched (2002-01-23) OS: Windows NT 4.0 Submission from: (NULL) (151.152.101.44) In read.fwf, ... args are passed to read.table, as stated in the documentation. However, passing comment.char in this manner is defeated by the call to scan that precedes the call to read.table. The problem is that scan has a default comment.char="#", and read.fwf doesn't pass ... to scan. A s...
2005 Oct 21
1
read.fwf(...,header=TRUE,...) (PR#8236)
Full_Name: Giovanni Bonafe' Version: 2.2.0 OS: Linux Submission from: (NULL) (195.62.164.225) If the file "example.dat" is like this: aaa bbb ccc 3.4 1.2 5.6 4.6 10 32 667 343 1.7 With the older 1.9.1, as expected: > data<-read.fwf(file = "example.dat",widths=c(3,4,4),header=TRUE) > data aaa bbb ccc 1 3.4 1.2 5.6 2 4.6 10.0 32.0 3 667.0 343.0 1.7 While with the newer 2.2.0: > data<-read.fwf(file = "example.dat",widths=c(3,4,4),header=TRUE) > data X3.4 X1.2 X5.6 1 4.6 10...
2010 Jun 05
1
Write.fwf works from Mac, throws different number of row error in Windows
Hello, I am having a problem with write.fwf in Windows. I wrote a code to ingest a number of text files with weather data in them, process them, and then output a text file with two parts: 1) a set of column names, 2) the processed data table. I wrote and tested the program on my Mac, and it worked fine. However, on the windows machine, wh...
2002 Jun 13
1
problem with read.fwf
Here is an example of the data I'm reading in using read.fwf: 5342.0 5450.4 0.9200 0.4506 34.7030 27.8411 37.1306 46.0034 0.0000 5438.0 5549.6 0.9300 0.4477-34.7280 27.8616 37.1506 46.0234 0.0000 And the commands I'm using to read it in: widths <- c(7,7,8,8,8,8,8,8,8) filedata <- read.fwf(fileopen, widths,sep="",dec=&qu...
2004 Sep 15
3
Read.fwf
...ansparent for this feature, but I can't seem to figure out how I can make effective use of the package with my data. In my dataset, the first 80 columns are of width 1 followed by other variables with width larger than 1. I think the correct way to do this, by brute force, would be > read.fwf(dataset, 1,1,1,...,1,5,...). I'm sure I do not need to actually enter 80 "1"s, correct? How might I do this more effectively? Harold [[alternative HTML version deleted]]
2010 Nov 12
1
issue with ... in write.fwf in gdata
Dear R-list This is just message to inform that the there is an issue with write.fwf in the gdata library (from version 2.5.0 on). It does not seem to accept further arguments to write.table like "eol" as the help file indicates as it stops when executing tmp <- lapply(x, format.info, ...). Great package though - I use it a lot except for this function :) See example...
1999 Oct 10
1
Using metric scaling
I want to enter a symmetric matrix containing distances for use in the cmdscale() metric scaling function. The matrix currently sits on a file in lower triangular form looking like this: 1 AWANUI RIVER .000 2 BLENHEIM .510 .000 3 COLLINGWOOD .510 .109 .000 4 FOXTON .510 .141 .141 .000 5 GISBORNE .549 .549 .549
2012 Mar 10
1
Subsetting a data.frame -> Read in with FWF format from .DAT file
Hi there, I am having trouble subsetting a data frame by a conditional via one column (of many). I read the file into R through "read.fwf," where I specified column widths. Original data is .DAT. I then utilized "names" function to read in column headings. For one column, PRVDR_NUM, I wish to further amend the entire data set, but only have PRVDR_NUM == 050108. This is where I'm having trouble. I've tried...