similar to: Wishlist: merge and subset to keep attributes (PR#8658)

Displaying 20 results from an estimated 2000 matches similar to: "Wishlist: merge and subset to keep attributes (PR#8658)"

2006 Mar 05
0
Wishlist: xtabs and table to optionally use attribute value labels (PR#8659)
Full_Name: Ulrike Gr?mping Version: 2.2.1 OS: Windows Submission from: (NULL) (84.190.139.94) A wish somehow related to my wish 8658: Package foreign allows to import categorical data from SPSS (and possibly other software) using the original codes, which are often useful for data manipulation, since one can use already available lists of codes from others who don't use R etc. The original
2012 Feb 26
1
Matrix problem to extract animal associations
Dear List, I have been trying to extract associations from a matrix whereby individual locations are within a certain distance threshold from one another. I have been able to extract those individuals where there is 'no interaction' (i.e. where these individuals are not within a specified distance threshold from another individual) and give these individuals a unique Group ID containing
2011 Apr 20
1
How to check if a value of a variable is in a list
Hi all, I am working with some social network analysis in R and ran into a problem I just cannot solve. Each observation in my data consists of a respondent, some characteristics and up to five friends. The problem is that all of these five friends might no show up later as a respondent (observation). Therefore I might not have characteristics on all the friends listed in the data and I want to
2016 Dec 27
0
colnames for data.frame could be greatly improved
Hi there, Any update on this? Should I create bugzilla ticket and submit patch? Regards Jan Gorecki On 20 December 2016 at 01:27, Jan Gorecki <J.Gorecki at wit.edu.pl> wrote: > Hello, > > colnames seems to be not optimized well for data.frame. It escapes > processing for data.frame in > > if (is.data.frame(x) && do.NULL) > return(names(x)) > > but
2016 Dec 20
2
colnames for data.frame could be greatly improved
Hello, colnames seems to be not optimized well for data.frame. It escapes processing for data.frame in if (is.data.frame(x) && do.NULL) return(names(x)) but only when do.NULL true. This makes huge difference when do.NULL false. Minimal edit to `colnames`: if (is.data.frame(x)) { nm <- names(x) if (do.NULL || !is.null(nm)) return(nm) else
2013 Jul 02
2
Recoding variables based on reference values in data frame
I'm new to R (previously used SAS primarily) and I have a genetics data frame consisting of genotypes for each of 300+ subjects (ID1, ID2, ID3, ...) at 3000+ genetic locations (SNP1, SNP2, SNP3...). A small subset of the data is shown below: SNP_ID SNP1 SNP2 SNP3 SNP4 Maj_Allele C G C A Min_Allele T A T G ID1 CC GG CT AA ID2 CC GG CC AA ID3 CC GG nc AA
2014 Jan 16
1
Doubt in simple merge
Dear R community I have a two data set called "Elder" and "Younger". This is my code for simple merge. Elder <- data.frame(   ID=c("ID1","ID2","ID3"),   age=c(38,35,31)) Younger <- data.frame(   ID=c("ID4","ID5","ID3"),   age=c(29,21,31)) mer <- merge(Elder,Younger,by="ID", all=T) Output I am
2006 Feb 09
1
List Conversion
Hello, I have a list (mode and class are list) in R that is many elements long and of the form: >length(list) [1] 5778 >list[1:4] $ID1 [1] "num1" $ID2 [1] "num2" "num3" $ID3 [1] "num4" $ID4 [1] NA I'd like to convert the $ID2 value to be in one element rather than in two.?? It shows up as c(\"num2\", \"num3\") if I try to use
2010 Sep 07
1
average columns of data frame corresponding to replicates
Hi Group, I have a data frame below. Within this data frame there are samples (columns) that are measured more than once. Samples are indicated by "idx". So "id1" is present in columns 1, 3, and 5. Not every id is repeated. I would like to create a new data frame so that the repeated ids are averaged. For example, in the new data frame, columns 1, 3, and 5 of the original
2016 Apr 04
0
multiple bar plot annotation text labelling
Use only plain text emails. Don't attach file types that will be stripped. See the footer at the bottom of your email for more information. Do give us the data using dput(): > dput(testbarplot) structure(list(V1 = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L), V2 = c(3L, 8L, 1L, 9L, 5L, 4L, 2L, 0L), V3 = structure(c(1L, 2L, 3L, 4L, 3L, 5L, 6L, 7L), .Label = c("A", "B",
2006 Jan 25
0
lazy evaluation (was RE: Number of replications of a term)
From: Thomas Lumley > > On Wed, 25 Jan 2006, Ray Brownrigg wrote: > > > There's an even faster one, which nobody seems to have > mentioned yet: > > > > rep(l <- rle(ids)$lengths, l) > > I considered this but it wasn't clear to me from the initial > post that > each ID occupied a contiguous section of the vector. > > Also, lazy
2016 Apr 04
2
multiple bar plot annotation text labelling
Readers, The attempt is to create a bar plot with text labels adjacent to each datum value. Data file: 1,3,A 1,8,B 1,1,C 1,9,D 2,5,C 2,4,E 2,2,F 2,0,G testbarplot<-read.csv('data1.csv', header=FALSE) barplot(axes=FALSE, ann=FALSE, horiz=TRUE, testbarplot[,2], ylab= 'group', xlab= '(x values)', space=c(1,0,0,0, 1,0,0,0)) text(testbarplot[,2], testbarplot[,1],
2014 Jan 19
5
how to replace <NA> values
Dear R community   I have a large data set contain some empty cells. Because of that,  may be I am wrong, <NA> values are produced. Now I want replace both empty and <NA> values with zero.   Elder1 <- data.frame(   ID=c("ID1","ID2","ID3","ID6","ID8"),   age=c(38,35,"",NA,NA)) Output I am expecting   ID   age ID1  38 ID2  35
2007 Mar 01
2
Query about data manipulation
Hi Thanks much for the prompt response to my earlier enquiry on packages for regression analyses. Along the same topic(?), I have another question about which I could use some input. I am retreiving data from a MySQL database using RODBC. The table has many BLOB columns and each BLOB column has data in the format "id1 \t id2 \t measure \n id3 \t id4 \t measure...." (i.e. multiple rows
2006 Jan 24
9
Number of replications of a term
Hello, Is there a simple and fast function that returns a vector of the number of replications for each object of a vector ? For example : I have a vector of IDs : ids <- c( "ID1", "ID2", "ID2", "ID3", "ID3","ID3", "ID5") I want the function returns the following vector where each term is the number of replicates for the
2004 Feb 13
3
Calculate Closest 5 Cases?
I've only begun investigating R as a substitute for SPSS. I have a need to identify for each CASE the closest (or most similar) 5 other CASES (not including itself as it is automatically the closest). I have a fairly large matrix (50000 cases by 50 vars). In SPSS, I can use Correlate > Distances to generate a matrix of similarity, but only on a small sample. The entire matrix can not
2007 Apr 20
2
Fastest way to repeatedly subset a data frame?
Hi - I have a data frame with a large number of observations (62,000 rows, but only 2 columns - a character ID and a result list). Sample: > my.df <- data.frame(id=c("ID1", "ID2", "ID3"), result=1:3) > my.df id result 1 ID1 1 2 ID2 2 3 ID3 3 I have a list of ID vectors. This list will have anywhere from 100 to 1000 members, and
2008 Jan 10
1
data.frame manipulation: Unbinding strings in a row
Hi all, I have a data.frame I received with data that look like this (comma separated strings in last row): ID Shop Items ID1 A1 item1, item2, item3 ID2 A2 item4, item5 ID3 A1 item1, item3, item4 But I would like to unbind the strings in col(2) items so that it will look like this: ID Shop Items ID1 A1 item1 ID1 A1 item2 ID1 A1 item3 ID2 A2 item4 ID2 A2 item5 ID3 A1 item1 ID3 A1 item3 ID3 A1
2011 Apr 25
2
Problem with ddply in the plyr-package: surprising output of a date-column
Hi Together, I have a problem with the plyr package - more precisely with the ddply function - and would be very grateful for any help. I hope the example here is precise enough for someone to identify the problem. Basically, in this step I want to identify observations that are identical in terms of certain identifiers (ID1, ID2, ID3) and just want to save those observations (in this step,
2005 Nov 09
3
dataframe without repetition
Hello, with a data.frame like this : > toto <- data.frame(id=c("id1","id1","id2","id3","id3","id3"),dpt=c("13","13","34","30","30","30")) > toto id dpt 1 id1 13 2 id1 13 3 id2 34 4 id3 30 5 id3 30 6 id3 30 what is the most efficient ways to obtain : id