Displaying 20 results from an estimated 1000 matches similar to: "R and SAS pointer/informat functionality"
2005 Oct 11
1
R data import
Hello,
I hope all is well. I've gone through and searched just about all the
manuals, faqs, contribs available on the data import/export process and
have not found any answer to a specific question. Hopefully, I will be
able to fall back upon the valuable expertise in mailing list. Here goes:
How can I import SPECIFIC columns of data in a fixed width file? E.g. I
have a fwf with 40
2006 Jul 13
1
writeForeignSAS and potential extensions
Dear R-devel,
I've made some potential extensions to writeForeignSAS
in 'foreign' that I wanted to pass along if anyone is
interested. I've attached the diff -u output against
the version found in foreign_0.8-15 and an .R file
with my changes. (In this .R file, the function is named
writeForeignSAS7 to simplify testing/comparisons.)
I've tried to alter the current
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 way to read the selected varaibles that I need without reading in the entire data
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
2006 Oct 30
4
read.fwf and header
Hi!
I have data (also in attached file) in the following form:
num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt
1 1 f q 1900-01-01 1900-01-01 01:01:01
2 1.0 1316666.5 2 a g r z 1900-01-01 01:01:01
3 1.5 1188830.5 3 b h s y 1900-01-01 1900-01-01 01:01:01
4 2.0 1271846.3 4 c i t x 1900-01-01 1900-01-01 01:01:01
5 2.5 829737.4 d j u w 1900-01-01
6 3.0
2006 Oct 30
4
read.fwf and header
Hi!
I have data (also in attached file) in the following form:
num1 num2 num3 int1 fac1 fac2 cha1 cha2 Date POSIXt
1 1 f q 1900-01-01 1900-01-01 01:01:01
2 1.0 1316666.5 2 a g r z 1900-01-01 01:01:01
3 1.5 1188830.5 3 b h s y 1900-01-01 1900-01-01 01:01:01
4 2.0 1271846.3 4 c i t x 1900-01-01 1900-01-01 01:01:01
5 2.5 829737.4 d j u w 1900-01-01
6 3.0
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
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:
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
2004 Sep 15
3
Read.fwf
Dear List
I have a fixed width file with variables of varying width. The help is
pretty transparent 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
>
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]]
2010 Feb 01
6
Import fixed-format ascii file with mixed record types
I need to import several ascii files in fixed format with two different record types. The data comes from European Labor Force Surveys, wich is a household survey. The first record type is for people over 16 years, and the second much sorter is for people aged 15 or less (this record has a filler with several blanks to get the same record length).
The files tipically have 160000 records, with 176
2008 Feb 26
3
Reading a file created with Fortran
Colleagues,
I am trying to read a file written by Fortran. Several lines of the
file are pasted below:
101 06e+050280.9777.484208.18147.20.246350.4020.7308717.882600 1 1
101 0.5 00280.9777.484208.18147.20.246350.4020.7308717.882600 0 0
101 1 00280.9777.484208.18147.20.246350.4020.7308717.882600 0 0
101 1.5 00280.9777.484208.18147.20.246350.4020.7308717.882600 0 0
101 2
2004 Jul 10
1
read.table, read.fwf, and na.strings (PR#7075)
# Your mailer is set to "none" (default 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
2009 Sep 08
7
Data separated by spaces, getting data into R using field lengths
I have a text file similar to this (separated by spaces):
x <- "DF12 This is an example 1 This
DF12 This is an 1232 This is
DF14 This is 12334 This is an
DF15 This 23 This is an example
"
and I know the field lengths of each variable (there is 5 variables in
this data set), which are:
varlength <- c(2, 2, 18, 5, 18)
How can I import this kind of data into R, using the varlength
2009 May 09
5
Reading large files quickly
I'm finding that readLines() and read.fwf() take nearly two hours to
work through a 3.5 GB file, even when reading in large (100 MB) chunks.
The unix command wc by contrast processes the same file in three
minutes. Is there a faster way to read files in R?
Thanks!
2008 Jun 08
3
how to important a date file into R
Hi:
I have a data file in the following format. The first three digits stand for the ID of a respondent such as 402, 403. Different respondents may have the same ID. Followed the ID are 298 single digit number ranging from 1 to 5. My question is how to read this data file into R. I tried "scan" and "read" but they do not work because the numbers in the file are not
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, where I intend the work to be done, when I run the
2011 Jun 28
4
Separator of data
Hi all,
I have a matrix like this:
188556644
225588666
558888555
I try to read the table using read table but if I put sep="" I have seen it
expects a white space, is there a "sep" option to read this matrix so
each single number is a position of the matrix
You see this matrix would be an 3x9 matrix
I tried other option but also didnĀ“t worked.
If sep = "" (the
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