similar to: Read.table - Less rows than original data

Displaying 20 results from an estimated 900 matches similar to: "Read.table - Less rows than original data"

2008 Jul 09
1
read.table problem
Dear all, I have problem when reading a table into R. The total row of read in table has is much less than the original saved table. I built a 1,273,230 by 6 data set named "mydata2", it was saved in the following command, write.table(mydata2, "mydata2.txt", row.name=F,col.name=T,quote=F,sep="\t") The next day I read in above saved text file into R,
2007 Mar 08
1
R: Searching and deleting elements of list
you could try mapply mydata2<-mapply("[", mydata, lapply(mydata, function(x) !x %in% A)) mydata2[[1]]<-A #to replace the obviously deleted elements of "A" mydata2 mydata2[[1]] mydata2[[2]] mydata2[[3]] mydata2[[4]] Stefano -----Messaggio originale----- Da: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch]Per conto di jastar
2001 Dec 19
2
How to create a data.frame "like" another, but longer?
Hello, does anyone know of a quick way to create a data frame "like" another, but with more rows? What I'd like to do is this: if mydata is a data.frame like a b c 1 TRUE yes 2 FALSE no 3 TRUE yes I'd like to get mydata2 with the same column names and column types, but without the values and with more rows. All I could think of was to manually do
2006 Feb 20
3
Boxplot Help for Neophyte
R helpers I am getting to grips with R but came across a small problem today that I could not fix by myself. I have 3 text files, each with a single column of data. I read them in using: myData1<-scan("C:/Program Files/R/myData1.txt") myData2<-scan("C:/Program Files/R/myData2.txt") myData3<-scan("C:/Program Files/R/myData3.txt") I wanted to produce a
2012 Jul 03
1
insert missing dates
Hello I have dataframes. mydata1 <-data.frame(value=c(15,20,25,30,45,50),dates=c("2005-05-25 07:00:00 ","2005-05-25 19:00:00","2005-06-25 07:00:00","2005-06-25 19:00:00 ","2005-07-25 07:00:00","2005-8-25 19:00:00")) or mydata2 <-data.frame(value=c(15,20,25,30,45,50),dates=c("2005-05-25 00:00:00 ","2005-05-25
2011 Jun 21
5
converting character to numeric
I'm trying to convert data from character to numeric. I've imported data as a csv file, I'm assuming that the import is a database - are all the columns in a database considered "vectors" and that they can be operated on individually Therefore I've tried the following mydata <- as.numeric(mydata$apples) when i then look at mydata again the named column is still
2009 Jan 06
5
Using apply for two datasets
I can run one-sample t-test on an array, for example a matrix myData1, with the following apply(myData1, 2, t.test) Is there a similar fashion using apply() or something else to run 2-sample t-test with datasets from two groups, myData1 and myData2, without looping? TIA, Gang
2006 Nov 09
1
dissimilarity matrices
Dear All, I have a dissimilarity matrix which I happily convert to a distance object by running: X <- as.dist(Y) and I can happily now run either hclust(X) or agnes(X). So that the various bits of output are labelled correctly I would dearly like to be able to give names to the columns and rows of X, as would happen if I ran: mydata<-read.table("clipboard",header=T)
2011 Feb 25
1
speed up process
Dear users, I have a double for loop that does exactly what I want, but is quite slow. It is not so much with this simplified example, but IRL it is slow. Can anyone help me improve it? The data and code for foo_reg() are available at the end of the email; I preferred going directly into the problematic part. Here is the code (I tried to simplify it but I cannot do it too much or else it
2008 Apr 15
2
How can I import user-defined missings from Spss?
Hi, It works for me to import spss datasets via library(foreign) with read.spss or via library Hmisc by (spss.get). But no matter which way I do import the data, user-defined missings from Spss are always lost. (it makes no difference if there are a single value, a range, or any combination of them. They are always ignored). Is there any way in R to find out if any value was user-defined missing
2009 Sep 14
1
ggplot2 legend text....a basic question
Hello fellow R's, I?ve been learning to use the ggplot2 library, and after a full day of work I still have a couple of basic questions. Here is an example: mydata=data.frame(x=runif(20),y=runif(20),n=runif(20)) mydata2=data.frame(x=c(0.4,0.6,0.5),y=c(0.4,0.4,0.6)) ggplot(mydata, aes(x, y)) + geom_point(aes(size = n)) + geom_polygon(data=mydata2,aes(x,y,alpha=0.5)) In this plot, the
2007 Jul 11
1
aov() question
Hi all, So I think I have seen some similar questions to mine when I searched the archives, but have not seen any concrete answers and was wondering if any one could help. I have been trying to use R's aov() function to analyze my data. I have a 3 x 4 x 2 repeated measures design. All of the IVs are within subjects. I do also have missing values (unequal N), as I have to remove
2010 Aug 05
2
try-error within for loop
Dear all, I run a loop wrapped in try(), and for each of the rows where "try-error" is true I want to fill that row with NA (at the moment it is omitted). So I would expect to get a dataframe with 1000 rows some of which would be empty, but instead I get a dataframe with 995 rows. In this case missing 5 rows were omitted. Any suggestions? Thanks, Olga ----------------
2012 Dec 18
0
R function for computing Simultaneous confidence intervals for multinomial proportions
Dear all, Does someone know an R function implementing the method of Sison and Glaz (1995) (see full ref below) for computing Simultaneous confidence intervals for multinomial proportions? As alternative method, I think to boostrap the mean of each proportion and get in that way confidence interval of the mean. I observed 21 times a response that could be one out of 8 categories
2008 Mar 30
2
tests Rin Rout
Hi the list, Some rumour (!) say that is it possible to prepare some tests for checking our code using .Rin and .Rout. It seems to be a very good practice, but I did not manage to find information on it. So does someone know how it works ? What are we suppose to write in Rin ? More precisely : - I have a package myPack.r in directories ~/myR/myPack/R/ - I create the directory
2007 Mar 08
1
Searching and deleting elements of list
Hi, I have a problem. Please, look at example and try to help me!! > A<-c("aaa","bbb","ccc","ddd","eee") > B<-c("vvv","ooo","aaa","eee","zzz","bbb") > C<-c("sss","jjj","ppp","ddd") > D<-c("bbb","ccc")
2010 Nov 11
2
Kolmogorov Smirnov Test
I'm using ks.test (mydata, dnorm) on my data. I know some of my different variable samples (mydata1, mydata2, etc) must be normally distributed but the p value is always < 2.0^-16 (the 2.0 can change but not the exponent). I want to test mydata against a normal distribution. What could I be doing wrong? I tried instead using rnorm to create a normal distribution: y = rnorm
2013 May 02
0
Data in packages: save or write.table?
Hi all, I am trying to understand Writing R Extension... Section 1.1.5, data: I include two datasets in a package, one using 'save', the other using 'write.table': --- 8< ---- myData1 <- data.frame(x=1:10) write.table(myData1,file="myData1.txt") myData2 <- data.frame(x=2:10) save(myData2,file="myData2.Rdata") --- 8< ---- Then R CMD check aks me to
2012 Dec 06
1
Fitting a multinomial model to a multi-way factorial design with repeated measures: help on package and syntax
Dear all, I studied in tank prey fish behavior. Using the design described below (and R code), I want to test the effects of both habitat and predator (and interaction) on prey fish's vertical distribution, which was recorded (with repeated measures) as a categorical variable. I found that package mlogit might fit to my need but I don't know how to specify my complex design in the
2008 Oct 01
2
Looking for position of character in a string
Hi all, I would like to check if a string contains "." in it. If yes, I would like to know the position of "." in the string. Eg: X<-"NM1236.3" In above example, "." is at position 7. I tried functions grep() and match(). It seems they couldn't detect ".". Thanks in advance for your help, Sityee [[alternative HTML version deleted]]