Displaying 20 results from an estimated 500 matches similar to: "Help create a loopto conduct multiple pairwise operations"
2007 Aug 30
2
How to multiply all dataframe rows by another dataframe's columns
Hello,
I have two data frames, X and Y, with two columns each and different numbers
of rows.
# creation of data frame X
Loc1.alleles <- c(1,5,6,7,8)
Loc1.Freq <- c(0.35, 0.15, 0.05, 0.10, 0.35)
Loc1 <- cbind( Loc1.alleles,Loc1.Freq)
X <- data.frame(Loc1)
#creation of data frame Y
Loc2.alleles <- c(1,4,6,8)
Loc2.Freq <- c(0.35, 0.35,
2007 Sep 19
0
Create a loop to conduct multiple pairwise binary operations Retry
#Hello,
# Sorry, my last letter contained an error this code should work
#I have three data frames, X,Y and Z with two columns each and different
numbers of rows.
# creation of data frame X
X.alleles <- c(1,5,6,7,8)
X.Freq <- c(0.35, 0.15, 0.05 , 0.10, 0.35)
Loc1 <- cbind( X.alleles,X.Freq)
X <- data.frame(Loc1)
#creation of data frame Y
Y.alleles
2007 Sep 27
2
create data frame(s) from a list with different numbers of rows
# Hello,
# I have a list with 6 categories and with different numbers of rows.
# I would like to change each of them into a unique data frame in order to
match
# values with other data frames and perform some calculations.
# Or I could make each category or list element have the same number of rows
and create one large data.frame.
# below is a creation of a sample list
# I apologize for the
2009 Sep 22
1
matching pairs regardless of order,multiple matches
Dear Jim and Henrique,
thank you both for your help. I have done this but run into another problem:
?
In the example?below "loc1,loc2" occurs in the (now correct, thanks to your advice) "list" twice. ?
?
trips=("loc1,loc2","loc2,loc3")
?
DF$listoftrips=("loc1,loc2", "loc1,loc3", "loc2,loc3","loc1,loc2").
?
I?am
2009 Sep 18
3
matching pairs regardless of order
Dear list,
?
I am using match() to match pairs of locations, e.g. trip="loc1,loc2" from a list of such pairs, e.g. list=("loc1,loc2", "loc1,loc3", "loc2,loc3","loc2,loc1").
?
In this example match() will match "trip" with the first element of "list", but not the 4th, because the order is reversed.
?
How can I get a match with
2011 Jan 17
2
Summing data frame columns on identical data
Dear all,
I have 9 data frames, and I'm simply trying to sum the values of column 3 (on a row-by-row basis). However, there are a slightly different number of rows in each data frame, so I'm receiving the following error: "Error in Ops.data.frame(mrunoff_207101[3], mrunoff_207102[3]) :
? + only defined for equally-sized data frames".
Here is what I'm attempting to do:
2013 Nov 01
1
Package(s) for making waffle plot-like figures?
Dear all,
I am trying to make a series of waffle plot-like figures for my data to
visualize the ratios of amino acid residues at each position. For each one
of 37 positions, there may be one to four different amino acid residues. So
the data consist of the positions, what residues are there, and the ratios
of residues. The ratios of residues at a position add up to 100, or close
to 100 (more on
2006 Dec 01
3
Make many barplot into one plot
Dear all,
## I have 4 tables like this:
satu <- array(c(5,15,20,68,29,54,84,119), dim=c(2,4),
dimnames=list(c("Negative", "Positive"), c("Black",
"Brown", "Red", "Blond")))
dua <- array(c(50,105,30,8,29,25,84,9), dim=c(2,4),
dimnames=list(c("Negative", "Positive"),
2008 Aug 10
1
Scripting - query
I have a vector:
alleles.present<-c("D3", "D16", ... )
The alleles present changes given the case I'm dealing with - i.e. either
all of the alleles I use for my calculations are present, or some of them.
Depending on what alleles are present, I need to make matrices and do
calculations on those alleles present and completely disregard any formula
or other use of the
2008 Apr 19
1
resampling from distributions
Hello All,
Once again thanks for all of the help to date. I am climbing my R learning
curve. I've got a few more questions that I hope I can get some guidance on
though. I am not sure whether the etiquette is to break up multiple
questions or not but I'll keep them together here for now as it may help put
the questions in context despite the fact that the post may get a little
long.
2008 Feb 20
2
Shorewall vpn and Messenger
I have installed the shorewall frontend with pptpd tunnelling server.
All works fine except only one thing:
When the outside users connect to my centos server to shorewall over
pptpd vpn tunneling then the client computer can''t login to live
messenger, but the customer can connect perfectly with skype, use mail,
internet etc... all of this program installed in their outside
computers.
2007 Mar 16
1
ideas to speed up code: converting a matrix of integers to a matrix of normally distributed values
Hi all,
[this is a bit hard to describe, so if my initial description is
confusing, please try running my code below]
#WHAT I'M TRYING TO DO
I'd appreciate any help in trying to speed up some code. I've written
a script that converts a matrix of integers (usually between 1-10,000
- these represent allele names) into two new matrices of normally
distributed values (representing
2003 Sep 04
1
Allelic Differentiation, sampling, unique(), duplicated()
Hi people,
I have made some progress trying to work out how to solve this problem
but I have got a bit stuck - sorry if this turns out to be a simple
exercise . .
Allelic Differentiation (AD) in genetics measures the number of
different alleles between (say) two populations eg:
Organisms in Pop 1 have alleles: a, b, c, d, e
Organisms in Pop 2 have alleles: b, b, c, d, e
Different
2005 Jul 07
3
What method I should to use for these data?
Dear R user:
I am studying the allele data of two populations.
the following is the data:
a1 a2 a3 a4 a5 a6 a7 a8 a9
a10 a11 a12 a13 a14 a15 a16 a17
pop1 0.0217 0.0000 0.0109 0.0435 0.0435 0.0000 0.0109 0.0543
0.1739 0.0761 0.1413 0.1522 0.1087 0.0870 0.0435 0.0217 0.0109
pop2 0.0213 0.0213 0.0000 0.0000 0.0000 0.0426 0.1702 0.2128
0.1596 0.1809 0.0957 0.0745 0.0106
2012 Jun 27
3
qplot and colors (Please Help)
Please help:
I am using qplot as below and want to specify a different color scheme for race but dont know how, can someone show me.
Thanks in advance
Code and input file below:
library(ggplot2)
library(gridExtra)
d<-read.table("results", header=TRUE, fill=TRUE)
plot2<-qplot(X,Y,data=d,color=race,facets=TYPE~., xlab="X", ylab="Y") + theme_bw()
2024 Nov 15
1
R coding to extract allele frequencies from NCBI for ALL alleles of one SNP?
Dear All,
The following code extracts from NCBI very nice output for ONE allele of a SNP (often the allele with the second largest frequency - usually termed the minor allele). It gives an average minor allele frequency from all NCBI sources (which is what I want, except I'd like the addition of data for all the other alleles of one SNP) plus a table of minor allele frequencies from each
2007 Oct 02
1
Trouble obtaining results from a loop
#Hello,
#I have a question about obtaining results from a loop I have written.
#Below is a sample of individual genotypes from a genetic question I am
working on called "P.genotype.sample ".
P.genotype.sample<-matrix(10,10,10)
P.genotype.sample[,1]<-c(2,2,1,5,1,1,5,6,1,3)
P.genotype.sample[,2]<-c(6,3,3,6,8,1,6,7,2,3)
P.genotype.sample[,3]<-c(2,2,2,3,3,2,2,2,3,3)
2007 Sep 26
1
Paste a matrix column in pairwise fashion with other columns?
#Hello,
#I have would like to paste a single column of a matrix
# in pair wise fashion with other columns based upon
# even and odd column numbers.
# I can do it in a very clunky fashion and I know there
# must be a better way. below is a sample matrix and my extremely
# clunky code that gets the job done for a small matrix, but i plan to
# do this on a much grander scale. any help would be very
2001 Sep 13
3
OT: ps -> eps -> MS Word
I've created a bunch of postscript trees (post.rpart), which I subsequently
edit in Adobe Acrobat 4.05 (I need additional labelling that isn't easy to
add with R). After editing the labels and annotations using Acrobat, I
then export the file to Adobe's .eps format so I can insert the picture
into a Microsoft Word 2000 document. The .pdf file distilled from the .ps
file is
2007 Oct 12
1
Addition operation based on specific columns and rows of two data frames
#Hello,
# I have a question about the addition of values in specific columns and
rows of a Data frame.
# Below I have created two data frames, X.df and "Y.df".
## creation of X.df data frame
X<- matrix(0,16,3)
X.df<-data.frame(X)
X.df[,1] <- c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)
X.df[,2] <- c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4)
names(X.df)[1]<-"L(A)a(i)"