similar to: list to dataframe conversion-testing for identical

Displaying 20 results from an estimated 3000 matches similar to: "list to dataframe conversion-testing for identical"

2013 Apr 24
1
matching observations and ranking
Hi, It is not that clear. If VAR1 is a match between columns AB001A, AB0002A, VAR2? between AB001A, AB362 and VAR3 between AB0002A and AB362: Also, I assume row8 match would be taken as 1. dat1<- read.table(text=" ? S.No AB001A AB0002A AB362 ?? 1?? -/-??????? C/C?? A/A??????????????????????? ??? 2?? C/C??????? C/C?? A/A??????????????????????? ??? 3?? C/C??????? C/C??
2011 Jun 23
2
Merging multiple data sets
Hi, I am trying to merge data similar to the example data below > dat0 id var1 var2 var3 2 1 0 1 3 1 0 1 4 0 1 1 5 0 1 1 > dat1 id var4 var5 var6 2 1 0 1 3 1 0 1 6 0 1 1 7 0 1 1 > dat2 id
2012 Jul 05
4
Exclude missing values on only 1 variable
Hello, I have many hundred variables in my longitudinal dataset and lots of missings. In order to plot data I need to remove missings. If I do > data <- na.omit(data) that will reduce my dataset to 2% of its original size ;) So I only need to listwise delete missings on 3 variables (the ones I am plotting). data$variable1 <-na.omit(data$variable1) does not work. Thank you
2007 Mar 23
2
concatenate 2 data.frames
Dear all, I would like to know how can I concatenate 2 data.frames into a single one. Both data frames have the same number of columns and the same class type in each correspondent column. So what I want is to have a new data.frame where I have first the values from one data.frame and then the values from a second data.frame would came after in this new data.frame. Thanks in advance. Med
2005 Apr 15
2
Help with "MERGE" gratefully accepted
Hello How do I use function 'MERGE" to combine the FILE A and FILE B below to make FILE C? Thank you FILE A 140 151 167 30.1 11.4 40 FILE B 140 167 5.7 30.3 FILE C 140 151 167 30.1 11.4 40 5.7 NA 30.3
2012 Aug 07
0
predicting test dataset response from training dataset with randomForest
Hi I am new to R so I apologize if this is trivial. I am trying to predict the resistance or susceptibility of my sequences to a certain drug with a randomForest function from a file with amino acids on each of the positions in the protein. I ran the following: > library(randomForest) > > path <- "C:\\..." > path2 <- "..." > name <-
2012 Dec 04
3
reformatting some data
Hello, I am trying to reformat some data so that it is organized by group in the columns. The data currently looks like this: group X3.Hydroxybutyrate X3.Hydroxyisovalerate ADP 347 4 4e-04 3e-04 5e-04 353 3 5e-04 3e-04 6e-04 359 4 4e-04 3e-04
2010 Mar 30
2
Need help to split a given matrix is a "sequential" way
I need to split a given matrix in a sequential order. Let my matrix is : > dat <- cbind(sample(c(100,200), 10, T), sample(c(50,100, 150, 180), 10, > T), sample(seq(20, 200, by=20), 10, T)); dat [,1] [,2] [,3] [1,] 200 100 80 [2,] 100 180 80 [3,] 200 150 180 [4,] 200 50 140 [5,] 100 150 60 [6,] 100 50 60 [7,] 100 100 100 [8,] 200 150 100 [9,]
2013 Sep 09
0
Duplicated genes
Hi, May be you can try this: dat1New<-? dat1[!(duplicated(dat1$gene)|duplicated(dat1$gene,fromLast=TRUE)),] dat2<-dat1[duplicated(dat1$gene)|duplicated(dat1$gene,fromLast=TRUE),] ?lst1<-split(dat2,dat2$gene) dat3<-unsplit(lapply(lst1,function(x) {x1<- sum(apply(x[,6:32],2,function(y) y[1]>=y[2]));x2<- sum(apply(x[,6:32],2, function(y) y[1]<=y[2])); if(x1>x2) x[1,] else
2010 Mar 22
1
Replacing elements of list
Dear all, I have following two list object, both are basically collection of matrices : dat1 <- matrix(rnorm(25*6), ncol=6) dat1 <- split(dat1, seq(5,25,by=5)) dat1 <- lapply(dat1, matrix, ncol=6) dat2 <- matrix(rnorm(25*4), ncol=4) dat2 <- split(dat2, seq(5,25,by=5)) dat2 <- lapply(dat2, matrix, ncol=4) Now I want to replace last 4 columns of each matrix at "dat1"
2011 May 17
1
Subsetting depth profiles based on maximum depth by group with plyr
Hello, Apologies for a similar earlier post. I didn't include enough details in that one. I am having a little trouble subsetting some data based on a grouping variable. I am using an instrument that does depth profiles of a water column. The instrument records on the way down as well as the way up. So thanks to an off-list reply I can subset the data so that all data collected at the
2013 Mar 14
0
reshape
Hi Elisa, You need to check your data.? For some 'st', the data is repeated/duplicated (I am assuming, didn't check it) especially for a particular year. dat1<-read.csv("elisa.csv",sep="\t") dat1$st<- as.character(dat1$st) ?str(dat1) #'data.frame':??? 506953 obs. of? 5 variables: # $ st?????? : chr? "AGOMO" "AGOMO"
2008 May 11
1
Finding unmatched data between two dataframe using several factors
Hi R users I am trying to find unmatched data from two dataframes. I would like to find unmatched data based on several factors. For the following data: dat1 <- data.frame(x = paste("A", 1:6, sep=""), y = c("andy","bob","ciaran","dan", "eion", "fred")) dat1 dat2
2013 Jan 21
1
Percentiles with R for a big data.frame
Dear R users, I came up to a problem dealing with percentiles in R. >From my previous questions: I do have a big data.frame, with lots of columns and rows. The following command enables me to calculate means for all data frame. dat1$newID<-rep(1:(nrow(dat1)/12),each=12) #if nrow(dat1)/12 is integer dat2<-with(dat1,aggregate(cbind(dat1[,1:71]),by=list(newID),mean)) What I need is to
2008 Mar 25
2
Compare two data sets
I would like to compare two data sets saved as text files (example below) to determine if both sets are identical(or if dat2 is missing information that is included in dat1) and if they are not identical list what information is different between the two sets(ie output "a1", "a3" as the differing information). The overall purpose would be to remove "a1" and
2013 Apr 29
1
how to add new rows in a dataframe?
Hi, dat1<- read.table(text=" id??????????????? t???????????????????? scores 2???????????????? 0??????????????????????? 1.2 2???????????????? 2???????????????????????? 2.3 2???????????????? 3??????????????????????? 3.6 2???????????????? 4??????????????????????? 5.6 2???????????????? 6??????????????????????? 7.8 3???????????????? 0??????????????????????? 1.6 3????????????????
2013 Jun 15
0
Calculate days with R
Hi, May be this helps: dat1<- read.table(text=" pbnr??????? dat? dep? dys? sop? ago? mis age female 1 10023 1994-02-21 0.75 1.00 0.50 0.50 0.75? 35????? 1 2 10023 1994-05-25 0.75 1.00 0.50 0.50 0.75? 35????? 1 3 10028 1994-02-01 2.00 1.75 3.00 0.50 1.50? 42????? 1 4 10028 1999-01-15 1.25 0.75 2.25 0.50 0.25? 42????? 1 5 10053 1994-03-16 2.50 0.75 1.25 0.50 1.25? 22????? 1 6 10053
2013 Apr 23
1
Extract part of a numer
Hi, May be this helps: set.seed(25) dat1<- data.frame(ID=c("1001#01","1001#02","1001#03","1002#01","1002#02"),val=rnorm(5),stringsAsFactors=FALSE) ?dat1$ID<-as.numeric(gsub("#.*","",dat1$ID)) ?dat1 #??? ID??????? val #1 1001 -0.2118336 #2 1001 -1.0415911 #3 1001 -1.1533076 #4 1002? 0.3215315 #5 1002 -1.5001299 A.K.
2012 Jan 16
3
Select rows based on multiple comparisons
Dear all, I have a data set in which the same unit appears 2 or 3 or 4 times. I need to aggregate this data to maintain only one unit by row. But I need to do that based on a comparison between the values of such units. I can't find a function to help me on that. I appreciate any help. Below I provide an example of what I want: This is my data: Units Var1 Var2 Var3 1 B 2
2017 Oct 20
1
create a loop
Hi R Users, I do have very big data sets and wanted to run some of the analyses many times with randomization (1000 times). I have done the analysis using an example data but it need to be done with randomized data (1000 times). I am doing manually for 10000 times but taking so much time, I wonder whether it is possible to perform the analysis with creating a loop for many replicated datasets?