Displaying 20 results from an estimated 2000 matches similar to: "Doubt in simple merge"
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
2006 Mar 05
2
Wishlist: merge and subset to keep attributes (PR#8658)
Full_Name: Ulrike Gr?mping
Version: 2.2.1
OS: Windows
Submission from: (NULL) (84.190.139.94)
When importing data from SPSS, it is a nice feature of the package foreign that
it allows (option use.value.labels=F) to work with the original SPSS codes while
keeping the value labels as information in an attribute. Unfortunately, after
merging or subsetting, these attributes disappear.
The code
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
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
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
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
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
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",
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
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],
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
2013 Apr 12
1
Removing rows that are duplicates but column values are in reversed order
Hi,
From your example data,
dat1<- read.table(text="
id1?? id2?? value
a????? b?????? 10
c????? d??????? 11
b???? a???????? 10
c????? e???????? 12
",sep="",header=TRUE,stringsAsFactors=FALSE)
#it is easier to get the output you wanted
dat1[!duplicated(dat1$value),]
#? id1 id2 value
#1?? a?? b??? 10
#2?? c?? d??? 11
#4?? c?? e??? 12
But, if you have cases like the one
2012 Apr 14
3
Choose between duplicated rows
Dear r experts,
Sorry for this basic question, but I can't seem to find a solution?
I have this data frame:
df <- data.frame(id = c("id1", "id1", "id1", "id2", "id2", "id2"), A =
c(11905, 11907, 11907, 11829, 11829, 11829), v1 = c(NA, 3, NA,1,2,NA), v2 =
c(NA,2,NA, 2, NA,NA), v3 = c(NA,1,NA,1,NA,NA), v4 = c("N",
2008 Jul 09
2
Parsing
Dear R users,
I have a big text file formatted like this:
x x_string
y y_string
id1 id1_string
id2 id2_string
z z_string
w w_string
stuff stuff stuff
stuff stuff stuff
stuff stuff stuff
//
x x_string1
y y_string1
z z_string1
w w_string1
stuff stuff stuff
stuff stuff stuff
stuff stuff stuff
//
x x_string2
y y_string2
id1
2005 Aug 10
1
Why only a "" string for heading for row.names with write.csv with a matrix?
Consider:
> x <- matrix(1:6, 2,3)
> rownames(x) <- c("ID1", "ID2")
> colnames(x) <- c("Attr1", "Attr2", "Attr3")
> x
Attr1 Attr2 Attr3
ID1 1 3 5
ID2 2 4 6
> write.csv(x,file="x.csv")
"","Attr1","Attr2","Attr3"
"ID1",1,3,5
2009 Dec 10
1
problem with data processing in R
Hi,
I'm stuck with parsing data into R for heatmap representation.
The data looks like:
1 id1 x1 x2 x3 .... x20
2 id1 x1 x2 x3 .... x20
3 id1 x1 x2 x3 .... x20
4 id1 x1 x2 x3 .... x20
.........
348 id2 x1 x2 x3 .... x20
349 id2 x1 x2 x3 .... x20
350 id2 x1 x2 x3 .... x20
351 id2 x1 x2 x3 .... x20
.........
The data is sorted for the IDs (id1,id2 .....id40) and I like to