similar to: filtering rows

Displaying 20 results from an estimated 2000 matches similar to: "filtering rows"

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,
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, but I would like to
2011 Jul 21
2
Latex Table Help on R
Hello everyone, 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)
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
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, do operations
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
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.
2011 Jul 20
1
Latex Table for means and standard deviations in brackets
Hello all, 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)
2017 Jun 21
0
Help/ Mathematics
Hi Ahmed, Your problem appears trivial as you have already specified the form of the calculation. Learn how to "extract" specified elements from a data structure: # first value sum(dataset1$NPP[dataset1$date >= date1 & dataset1$date <= date2]) # second value dataset2$biomass[dataset2$date == date2] - dataset2$biomass[dataset2$date == date1] # third value
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) PeriodResType_Zx <-
2009 Jul 15
1
loading multiple .Rdata and preserving variable names
Dear R-users, I need to load outputs from multiple previous calculations into one R session for comparison and (cross-)analysis. The previous calculations are stored in different directories in .Rdata files (I don't know if this is the best storage for later usage, but the previous project could be recalculated and saved into different format, if needed, potentially.) I can load consequently
2009 Sep 22
2
Creating loops with strings
Hello. I'm trying to run a series of commands 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 <-
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
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.
2009 Mar 27
2
Remove error data and clustering analysis
Hi, all, I?d like to do the clustering analysis in my dataset. The example data are as follows: Dataset 1: 500, 490, 486, 490, 491, 493, 480, 461, 504, 476, 434, 500, 470, 495, 3116, 3142, 12836, 3062, 3091, 3141, 3177, 3150, 3114, 3149; Dataset 2: 506, 473, 495, 494, 434, 459, 445, 475, 476, 128367, 470, 513, 466, 476,482, 1201, 469, 502; I had so many datasets like that. Basically, every
2004 Mar 09
1
vector extraction
Hello, I could need some help on this one: >From the data.frame "Test.dataset2" below (TSCS data for 151 "countries.to.map" for "year" 1973-95; each "country.to.map" is described by a unique code), I would like to extract a vector "color" that for each "country.to.map" takes on the value of "dv" (a categorical variable with
2007 Jun 13
3
Awk and Vilno
In clinical trial data preparation and many other data situations, the statistical programmer needs to merge and re-merge multiple input files countless times. A syntax for merging files that is clear and concise is very important for the statistical programmer's productivity. Here is how Vilno does it: inlist dataset1 dataset2 dataset3 ; joinby variable1 variable2 where ( var3<=var4 ) ;
2001 Jun 06
1
ppr, number of terms, and data ordering
Dear R listers -- I have several questions about using the ppr command in the modreg module. I discovered -- quite by accident -- that if I re-order the data, I obtain different results. The output below shows what I mean. I have two datasets (dataset1 and dataset2) that are identical (tested using proc compare in SAS) except for the fact that the records are in different order. Below I have
2011 Sep 16
3
question concerning the acf function
Hi everyone, I've got a question concerning the function acf(.) in R for calculating the autocorrelation in my data. I have a table with daily returns of several stocks over time and I would like to calculate the autocorrelation for all the series (not only for one time series). How can I do this? After that I want to apply an autoregressive model based on the estimated lag in the
2011 Sep 27
4
Question concerning Box.test
Hi everyone, I've got a question concerning the function Box.test for testing autocorrelation in my data. My data consist of (daily) returns of several stocks over time (first row=time, all other rows=stock returns). I intend to perform a Box-Ljung test for my returns (for each stock). Since I have about 3000 stocks in my list, I'm not able to perform the test individually for each