search for: dataset1

Displaying 20 results from an estimated 63 matches for "dataset1".

Did you mean: datasets
2013 Mar 07
1
create vector from indices interpolated values
Readers, Is it possible to create a plot command based upon the indices of missing values in a data set? dataset1<-read.table(text=' 10 2 20 NA 30 5 40 7 50 NA 60 NA 70 2 80 6 90 NA 100 9 ') dataset2<-read.table(text=' 0.2 0.4 0.1 0.9 0.2 0.3 1.1 0.7 0.9 0.6 0.4 ') The 'approx' function is used to obtain the interpolated values for 'NA' in dataset1. dataset1interpolated...
2011 Jun 01
1
Replacing variables in one dataset with those from another
Hoping someone out there can help me...this seems like an easy task but I can't figure it out... I want to replace variables in one dataset (Dataset1) with a variable from another dataset (Dataset2). All the values for variables x1 and x2 in Dataset1 have a unique match to the variable uniquenum in Dataset2. For example, in Dataset1 grpnum A has a value of 343 for variable x1. In Dataset2, 343 will only be found once for variable uniquenum....
2011 Oct 11
1
filtering rows
Hi everyone, I've got two data sets as below. My question now is: how can I use Dataset2 as a filter for Dataset1? My goal is just to keep the rows of Dataset1 where the first column (Date) matches the Dates in Dataset2. I would appreciate any solutions to this issue. Many thanks! S.B. Dataset1: Date A B C D 1 1977...
2012 Feb 09
1
sample points - sp package
When I make a sample in sp, for example a random samping of 5 points in dataset1: sample.dataset1=spsample(dataset1, n = 5, "random") I have a sp object for the selected sampling... My question is : How can I extract from dataset2 the points & data for the coordinates(sample.dataset1) ? The dataset2 would be an object with the same area and coordinate system,...
2010 Dec 04
2
Question about #1 zoo-faq
...: "some methods for 'zoo' objects do not work if the index entries in 'order.by' are not unique." I checked if I have some duplicates in the 'Time' column, R says yes, but when I check the data set I can't explain why. Here is the code. > sum(duplicated(dataSet1$Time)) [1] 5 > x <- which(duplicated(dataSet1$Time)) > dataSet1[x,] Time fkl010z0 tre200s0 gre000z0 prestas0 rre150z0 tde200s0 ure200s0 4046 2009-03-29 02:10:00 0.5 3.0 0 942.1 0 1.9 92.7 4047 2009-03-29 02:20:00 0.3 2.7...
2009 Nov 17
3
Perform operations on dataframes called with paste in loops
In a loop, I compose the name of a csv file using paste, then read it (e.g., dataset1.csv, dataset2.csv, etc). The name of the dataframe assigned to the imported csv is also composed with paste (e.g., dataset1, dataset2, etc.). Now I want to perform operations on the dataframes dataset1, dataset2, etc. However, the paste function only renders a string on which I can not, for example...
2017 Nov 08
3
Adding Records to a Table in R
Dear Eric, Hope you are doing great. I also tried the following: #First I created the complete date sequence TransitDateFrame <- data.frame(TransitDate=seq(as.Date(dataset1[1,1]), as.Date(dataset1[nrow(dataset1),1]), by = "month")) #Then I did the merging dataset1NEW <- merge(TransitDateFrame, dataset1, by="TransitDate", all.x=TRUE) Now it has, as expected the total number of rows. The problem is, it filled absolutely everything with NAs, an...
2017 Nov 08
0
Adding Records to a Table in R
Hi Instead of attachments copy directly result of dput(TransitDateFrame) and dput(dataset1) to your email. Or, if your data have more than about 20 rows you could copy only part of it. dput(TransitDateFrame[,1:20]) dput(dataset1[,1:20]) Only with this approach we can evaluate your data in all aspects and provide correct answer. Cheers Petr > -----Original Message----- > From: R...
2011 Jul 21
2
Latex Table Help on R
...ryone, Peter (see my earlier post) recommended the following script for finding the means and standard deviations and putting them in table form. However, I would like the standard deviations under the means in brackets. Can anyone check this code to see how this can be adjusted? library(xtable) dataset1 = matrix( c(1,2,3,4, 5, 6 ), 2 , 3) dataset2 = matrix( c(4,3,5,10, 1, 0), 2, 3) dataset <- rbind(dataset1,dataset2) #combine dataset means <- apply(dataset,1,mean) #calculate row means sds <- apply(dataset,1,sd) #calculate row standard deviation msd <- paste(round(means,2),&qu...
2009 Sep 22
2
Creating loops with strings
...ands in two different datasets. For make it efficient I want to make a loop for it. Until now the only command for loops i found it's the for() command it's only for series of numbers and not a series of strings, witch it's what i'm needing. It would be something like this for(i in dataset1 dataset2) { i <- read.dta("dataset1.dta") ls() summary(i) str(i) attach(i) } I hope the idea it's clear. I'm using 2.9.1 Windows Version of R. Thanks. -- View this message in context: http://www.nabble.c...
2006 Aug 02
1
questions on aggregate data
Dear friends, my question is how to aggregate dataset and the inverse manipulation. e.g.My dataset data structure1: x 1 1 2 3 3 data structure2: x freq 1 2 2 1 3 2 Then how to generate dataset2 from dataset1 and generate dataset1 from dataset2? e.g. dataset2 from dataset1 : x<-c(1,1,2,3,3) a<-tab(x) as.data.frame(a) *But i can't do the inverse manipulation:generate dataset1 from dataset2*, anybody can help me on the two different manipulations? Thanks a lot! -- Kind Regards, Zhi Jie,...
2012 Aug 09
2
correlating rows of two differently-sized data frames in R
Hello everyone, I have two sets of data, with the following structure: DataSet1 Location Part Sample 1 Sample 2 A 1 value value A 2 value value A 3 value value B 1 value value DataSet2 Location Sample 1 Sample 2 A...
2011 Jul 20
1
Latex Table for means and standard deviations in brackets
..., I am new to xtable. I have several datasets in the form of matrices. Consider the following two simple datasets which are 2 x 3 matrices. The rows in both matrices have the same meaning. For example the first row of both matrices are variable 1 and the second row of both matrices are variable 2. dataset1 = matrix( c(1,2,3,4, 5, 6 ), 2 , 3) dataset2 = matrix( c(4,3,5,10, 1, 0), 2, 3) I would like to find the means and standard deviations in brackets for each data set in the form of a table that looks like: dataset1 dataset2 var1 2 3 (1.3) (2.5) var2...
2009 Jul 15
1
loading multiple .Rdata and preserving variable names
...needed, potentially.) I can load consequently multiple .Rdata files (in which variable names are identical), but I don't know how to preserve variables from these files or make them unique. I would imagine pointing them as in a list: # loading 2, max. 4 outputs of previous calculations load(DataSet1) # VariableA is present load(DataSet2) # VariableA is present, too # both VraiableA listed and present DataSet1$VariableA$parameters DataSet2$VariableA$parameters But what is the way to feed all variables into a list? Or more generally, what is an efficient way to work with multiple separate outp...
2003 Mar 11
1
about yesterday predicted values
I don't understand where is my problem. I tried the problem suggested by Prof. Brian Ripley data(USAccDeaths, package="ts") and it worked. So this is not a machine or configuration problem. This is my series (dataset1.ts) Jan Feb Mar Apr May Jun Jul Aug 1998 20957656 22280838 28048581 32286754 36456729 35575315 34127179 34363108 1999 20597673 22495503 32313913 34403642 39324570 38507480 36640790 36217094 2000 24841914 28977013 34243366 38180015 49119602 43809914 41...
2010 Mar 03
5
Matching rows in a Data set? I'm Stuck!!
Hi, I'm having (yet another) problem with R. I have a few data sets that have this sort of format dataset1 ID DATA 1234 value 2345 value 3456 value dataset2 ID DATA 1111 value 2345 value 3333 value What i really want to do is write an R script that says "if the ID of dataset1 and 2 match (2nd row), print out that whole row into a new dataset3". No idea how to do that though. Normally I would...
2011 May 25
1
Subtracting rows by id
Dear R users, I have two datasets: id1 <- c(rep(1,10), rep(2,10), rep(3,10)) value1 <- sample(1:100, 30, replace=TRUE) dataset1 <- cbind(id1,value1) id2 <- c(1,2,3) subtract.value <- c(1,3,5) dataset2 <- cbind(id2, subtract.value) I want to subtract the number of rows in the subtract.value that corresponds to the id value in dataset1. So for the 1 in id1, I want to remove the first row, for 2 in id1 I wan...
2010 Aug 19
4
Aggregate Help
Please let me know if this is or is not the right place to ask these types of questions. Warning: I am new to R by two days. I have a simple dataset. I have loaded the dataset successfully using the following code: Filepath=(C:\temp\\pilot\dataset1.txt") Pilot=read.table(filepath, header=TRUE) Dataset1.txt is delimited and looks like this: Date illness count 2006/01/01 derm 17 2006/01/01 derm 35 2006/01/02 derm 24 2006/01/02 derm 80 . . . Total records like this approximately 18,000 I would like to use the aggregate function to sum t...
2012 Jan 13
2
More issues with apply
Hi all, Please consider the following: DataSet1.. <- data.frame(Bldgtype=c("SFDM","SFDM","SFDM","SFDM","SFDM","SFDM","APT"), Taz=c("254","254","254","564","564","564","564"),stringsAsFactors = FALSE) Peri...
2011 Nov 22
1
Rcmdr numSummary: means of multiple variables without grouping
...ary in Rcmdr and selecting more than one variable (without grouping), the grand mean across all variables is returned for each variable instead of the mean of each single variable. However, this happens only for the mean, and not for sd, quantiles and na. This is the output: > numSummary(dataset1 [,c("var1", "var2")], + statistics=c("mean", "sd", "quantiles"), quantiles=c(0,.25,.5,.75,1)) mean sd 0% 25% 50% 75% 100% n NA var1 15.58491 4.154637 10 14 15 19.5 28 54 0 var2 15.58491 5.904053 5 10 15 18...