Displaying 20 results from an estimated 80000 matches similar to: "read.table with many blanks"
2008 Nov 12
1
read.table with many blanks (reposting)
Thanks Jim for pointing out how to properly ask.
Here is is my question and a small subset of the data and output.
I have a data set with many blanks. The blanks should be replaced with zero
once imported.
I tried read.table, read.csv (R 2.8 version),or scan, but none was
successful.
Any suggestion, please..
thanks.
Keun-Hyung
>garoben=read.table("c:\\Rdata\\garoben.txt",header=T,
2008 Nov 11
1
data type problem for vegan package
Dear all,
I'm using R2.8 version, and am trying to do NMDS and calculate other
diversity indices in vegan package.
The problem is that it works with a small set of data (43 X 23; row by
column), but the following error message comes up with a larger data set (43
X 104) (it seems not large to me at all). I made it sure that all data are
of numeric type as required.
>gh1.H=diversity(gh1)
2008 Jun 01
2
optim error - repost
Here is a clean version. I did this with nls and it works (see below), but
I need to do it with optim. Keun-Hyung
# optim
vol<-rep(c(0.03, 0.5, 2, 4, 8, 16, 32), 3)
time<-rep(c(2,4,8),each=7)
p.mated<-c(0.47, 0.48, 0.43, 0.43, 0.26, 0.23, NA, 0.68, 0.62, 0.64, 0.58,
0.53, 0.47,
0.24, 0.8, 0.79, 0.71, 0.56, 0.74, 0.8, 0.47)
eury<-data.frame(vol=vol, time=time, p.mated=p.mated)
2008 Jun 01
2
optim error
I saw a similar question but I still don't fully understand how to implement
optim.
Can someone help me out with this?
Thanks. Keun-Hyung
> vol<-rep(c(0.03, 0.5, 2, 4, 8, 16, 32), 3)
> time<-rep(c(2,4,8),each=7)
> p.mated<-c(0.47, 0.48, 0.43, 0.43, 0.26, 0.23, "null", 0.68, 0.62, 0.64,
0.58, 0.53, 0.47,
+ 0.24, 0.8, 0.79, 0.71, 0.56, 0.74, 0.8, 0.47)
>
2008 Dec 22
3
row sum question
Dear helpers,
I'm using R version 2.8.0.
Suppose that I have a small data set like below.
[,1] [,2] [,3] [,4]
a 1 1 0 0
b 0 1 1 0
c 1 1 1 0
d 0 1 1 1
First, I'd like to find row sum of values uniquely present in each row, but
only sequentially from the top row, meaning that if the value is shown in
the above row(s) already, the
2010 Aug 13
1
subsetting data points within confidence limit
Dear R-list
Suppose I have a data set stored in hmet, for which I did get confidence
limit on a linear regression as shown below.
My question is how I can subset only data points which are within the
confidence limit.
Thank you.
Keun-Hyung
---------------------------------------------------------------
Al=rnorm(100, 3)
Cd=rnorm(100, 0.2)
hmet=data.frame(Al=Al, Cd=Cd)
plot(Al,
2009 Apr 29
2
reading csv file : blanks
Hi,
I have a comma seperated data file which has blanks in it. I am trinying to
import it to R using
data1<-read.csv("oa_2006.csv", header = TRUE, sep = ",", quote="\"",
dec=".")
I want the missing values to be "NA". instead R reads them as "U". Any idea
why this happens ?
Thanks in advance.
Regards,
Nataraju
GM
2006 Jul 21
4
Reading data with blank elements
Hi,
I have a dataset saved in *.csv format, that contains
13 columns (the first column being the title name and
the rest experiments) and about 2500 rows.
Not all columns in the row have data in it
i.e for eg
BS00,-0.084,0.0136,-0.1569,-0.6484,1.103,1.7859,0.40287,0.5368,0.08461,-0.1935,-0.147974,0.30685
BS01,0.491270283,0.875826172,,,,,,,,,,
2012 Sep 13
1
cannot read iso639 table
line 109 did not have 5 elements ... but it did!
empty beginning of file ... but it's not!
details:
--8<---------------cut here---------------start------------->8---
get.language.ISO.table <- function () {
socket <- url("http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt",
open="r",encoding="utf-8");
data <-
2003 Nov 05
1
read.table leaves out data when reading multiple-line records (PR#4955)
Dear all,
I discovered that read.table (RW1.8.0) leaves out data when reading
multiple-line records.
Replication code at the end
Best regards
Jens Oehlschlägel
> filename <- "c:/tmp/c2.csv"
>
> data <- data.frame(a=c("c", "e\nnewline"), b=c("d", '"quoted
simpleline"'))
>
> #look at the data
>
2011 Jun 24
0
replacing empty cells, and Date question
Hello, I have a data set like one below.
First,
I'd like to replace the empty cells with NA, and then the one immediately
above.
I could replace NAs with the immediate one, but don't know for the empty
cells.
index <- which(is.na(data1$year))
while (any(index)) {
dummy$data1[index] <- dummy$data1[index - 1]
index <- which(is.na(data1$year))
}
Second,
The id
2001 May 10
2
Scanning data lines with blanks in character vars
Hello, I'm trying to read data in from a file using scan(). The last field is a
character string that contains blanks. I had read it in in S-Plus using this
code:
ifile <- list(entry=0,measure=0,st=0,count=0,score=0,
error=0,inmsq=0,instd=0,outms=0,outstd=0,displc=0,ptbis=0,a=0,
r="",name="")
if.widths <- c(1, 5, 8, 3, 6, 7, 7, 7, 7, 7, 7, 7, 7, 2,
2001 Jul 31
3
detecting blanks in read.table()
Hi everyone,
I am trying to read in a tab delimited data file to R that has outliers
marked by blank spaces. I would like to be able to tag those as "NA"
when the data is read in. I cannot figure out how to do this using the
read.table() options. Everything I have tried either puts all the NA on
the end of the row when there are missing values instead of on their
appropiate columns
2003 May 17
1
read.table fails with \246 separator (PR#3035)
Full_Name: Don Allen
Version: 1.6.2
OS: Solaris
Submission from: (NULL) (140.186.148.11)
If you use '\246' to separate fields in a csv-like file, read.table fails if
you
have more than 5 lines in the file (in the following, the separators in junk.csv
are really '\246's, despite the way they printed):
Fails:
>
2008 Jul 30
2
problem with read.table()
Hello R-User
I have a table as tab-delimited textfile (291 rows, 83 columns).
The first row are labels and the first line the variable names.
I used the following code several times with different similar tables and it
always worked.
But now:
setClass("of")
setAs("character", "of", function(from) as.ordered(from))
Classe82<-cclasses <-
2007 Nov 28
2
how to read in a txt file with some blanks
Hi list,
Is there a way to read in a txt file with some blanks? The ideal way could
be to replace blanks with NAs.
Thanks a lot!
Allen
[[alternative HTML version deleted]]
2007 Jun 18
2
to read table
Hello,
I have a problem to read a csv table. To read it I used this syntax
> donParCara <- read.table("C:/Documents and Settings/melyakhlifi/Mes documents/feuilles excel/calcul2.csv",header=TRUE,sep=";",quote="",dec=",")
I don't understand my errors
Erreur dans scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
la
2009 Jun 02
3
How to convert blanks to NA
Hi R-helpers,
I have imported data from Excel using the following code:
library(xlsReadWrite)
data <- read.xls(data,colClasses=c("character"))
and this results in all of the empty (blank) cells in the imported
Excel file also being empty (blank) in the resulting dataframe.
I am not used to having blanks (rather NAs) and I think these are
caused by the colClasses argument.
I would
1999 Feb 10
1
problems with read.table
Dear R users,
I have the following problem:
I have a table in ASCII-format, separated with commas. I can read it as
long as no field contains a comma itself. If one does, read.table doesn't
function even though that field is double-quoted.
Ex.:
File "test.csv":
Name,Strasse,PLZ
Jsaac,Gossauerstrassee 29,9100
Roth-Bernasconi,"20, ch. des Fauvettes",1212
adressen <-
2011 Sep 08
2
problems with function read.table
Hello everyone
I have a couple of questions about the usage of the R function
"read.table(.)". My point of departure is that I want to import a matrix
(consisting of time and daily stock returns of many stocks) in R. Most of
the data is numeric, however some values are missing (blanks) and in other
cases I have the character "#DIV/0!" (from excel). My goal is to do some