similar to: making chains from pairs

Displaying 20 results from an estimated 5000 matches similar to: "making chains from pairs"

2012 Sep 24
4
serial subtraction within a vector
Hello, I have a vector (numeric) v-> c(a,b,c,d,e) and I want to create the vector n->c(b-a,c-b,d-c,e-d). How can I do that? Thank you Hermann [[alternative HTML version deleted]]
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers #I have a data panel of thousands of firms, by year and industry and #one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not #and another variable the represents the firm dimension (total assets in thousand of euros) #I need to create two separated samples with the same number os firms where #one firm in the first have a corresponding
2013 Jan 03
5
count appearence of zero in a vector
Hello, I wish to count how often zero (0) appears in the vector test. test [1] 1 1 1 1 1 1 2 1 1 1 0 2 0 1 1 0 0 0 1 1 1 0 1 2 1 1 1 1 1 1 I think of something like ... > sapply (test, function (x) if (x==0 ... ... but actually I dont know how to carry on. Could anybody give me a hint? Thanks Hermann [[alternative HTML version deleted]]
2012 Sep 05
2
Installing lumi and hdrcde
To whom it may concern. As I would like to analyse some array data I was keen on downloading the lumi package that depends obviously on hdrcde that is not available for r 2.12.1. I did not find instructions to solve or circumvent this problem. Installing hdrcde by hand did not work either. It was not detected by > (.packages(all.available=TRUE)) if installed in the R library. Thanks Hermann
2013 Mar 29
3
From a vector with characters to binary information
Hello, I would like to transform a character vector into a "binary" vector ("keine" and " " become 0 and the rest 1). > dput (scm) c("keine", " ", "keine", "Erstgradverw.", "Mutter", "Erstgradverw.", "Erstgradverw.", "keine", " ", "Vater",
2013 Apr 24
2
Distance matrices Combinations
Dear UseRs, MY PROBLEM IS A SMALL PIECE OF A REAL BIG AND A COMPLICATED PROBLEM. IF I DELIBERATE IN A VERY SIMPLE WAY THEN ALL I WANT IS TO PUT ALL THE POSSIBLE COMBINATIONS OF 75 DISTANCE MATRICES (BY TAKING 4 MATRICES, MORE COMMONLY 75C4), in the following equation. t<-as.matrix((MAT1)^2+(MAT2)^2+(MAT3)^2+(MAT4)^2+,upper=T,diag=T)) Then "1215450" values of "t"(one for
2012 Sep 10
3
plot: x and y chromosomes are missing
Hello, I have a list with gene names, fold changes (=expression level) and chromosomes. Names fold change chromosome hz 1.5 2 If I plot fold change versus chromosome (or vice versa): plot (ch, fc) I see only the chromosomes with numbers but not those with letter (x and y). What can I do? A second question: How can I add a single line in that plot at a certain
2012 Sep 15
2
qplot: plotting precipitation data
Dear list, I wish to plot chromatin precipitation data: I would like to have a rectangles (x:end-start, y:peak) but I do not have an idea how to define x (in terms of qplot syntax) and to choose the correct geom. mydata is a subset of a larger file. > mydata chrom start end peak 1 chr11 5291000 5291926 8 2 chr11 10988025 10988526 7 3 chr11 11767950 11768676 8 4
2012 Nov 05
2
fusion of overlapping intervals
Hello, I have start and end coordinates from different experiments (DNase hypersensitivity data) and now I would like to combine overlapping intervals. For instance (see my test data below) (2) 30-52 and (3) 49-101 are combined to 30-101. But 49-101 and 70-103 would not be combined because they are on different chromosomes (chr a and chr b). Does anybody have an idea? Thanks Hermann > df
2012 Nov 01
2
subset a defined row plus the aforegoing
Hello, my data is sorted by start.ens (see below). And now I would like to extract all rows (so called* defined row*s) with type==Expression - subset (df, type==Expression) - and the aforegoing type==DNase HS (which is not necessarly row n-1 - assumung that the defined row is n). I dont know how to add this to my subset command. Is that possible? Thanks Hermann > df start.ens fc.trans
2007 Feb 08
5
remove component from list or data frame
Sorry to ask such a simple question, but I can't find the answer after extensive searching the docs and the web. How do you remove a component from a list? For example say you have: lst<-c(5,6,7,8,9) How do you remove, for example, the third component in the list? lst[[3]]]<-NULL generates an error: "Error: more elements supplied than there are to replace" Also,
2013 Apr 10
6
means in tables
Hi. I have 2 tables, with same dimensions (8000 x 5). Something like: tab1: V1 V2 V3 V4 V5 14.23 1.71 2.43 15.6 127 13.20 1.78 2.14 11.2 100 13.16 2.36 2.67 18.6 101 14.37 1.95 2.50 16.8 113 13.24 2.59 2.87 21.0 118 tab2: V1 V2 V3 V4 V5 1.23 1.1 2.3 1.6 17 1.20 1.8 2.4 1.2 10 1.16 2.6 2.7 1.6 11 1.37 1.5 2.0 1.8 13 1.24 2.9 2.7 2.0 18 I need generate a table of averages, the
2013 Sep 05
2
binary symmetric matrix combination
Hi, May be this helps: m1<- as.matrix(read.table(text=" y1 g24 y1 0 1 g24 1 0 ",sep="",header=TRUE)) m2<-as.matrix(read.table(text="y1 c1 c2 l17 ?y1 0 1 1 1 ?c1 1 0 1 1 ?c2 1 1 0 1 ?l17 1 1 1 0",sep="",header=TRUE)) m3<- as.matrix(read.table(text="y1 h4??? s2???? s30 ?y1 0 1 1 1 ?h4 1 0 1 1 ?s2 1 1 0 1 ?s30 1 1 1
2007 Jul 18
1
Neuman-Keuls
hello, I have programmed this function to calculate the Neuman-Keuls test but I have a problem the function return an empty list and I don't know why. summary(fm1) E <- sqrt((summary(fm1)[[1]]["Residuals","Mean Sq"])/length(LR)) lst <- list() lst1 <- list() lst2 <- list() NK <- function (x) { if (length(x) == 2) { Tstudent <- t.test(subset(exple,
2008 Oct 01
3
lapply where each list object has multiple parts
Hi. I have a list where each object in the list has multiple parts. I'd like to take the mean of just one part of each object. Is it possible to do this with lapply? If not, can you recommend another function? Thanks. eric > x1 <- c(0,1,2,3) > x2 <- c(7,8) > x3 <- c(2,6,6,8) > x4 <- c(4,8) > > Lst1 <- list(label1 = x1,label2 = x2) > Lst2 <-
2013 Sep 20
3
search species with all absence in a presence-absence matrix
Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absence (0) of the species in an island. Now I would like to search the species with absence (0) in all the islands (Island A to Island O.)
2013 Oct 04
3
Trying to avoid nested loop
Dear R users. I'm trying to avoid using nested loops in the following code but I'm not sure how to proceed. Any help would be greatly appreciated. With regards,Phil X = matrix(rnorm(100), 10, 10) ## Version with nested loopsresult = 0 for(m in 1:nrow(X)){ for(n in 1:ncol(X)){ if(X[m,n] != 0){ result = result + (X[m,n] / (1 + abs(m - n))) } }} ## No loop-sum(ifelse(M
2013 Apr 13
2
Comparison of Date format
Hi, ?In the example you provided, it looks like the dates in Date2 happens first.? So, I changed it a bit.? DataA<- read.table(text=" ID,Status,Date1,Date2 ??? ??? ?????? 1,A,3-Feb-01,15-May-01 ??? ??? 1,B,15-May-01,16-May-01 ??? ??? 1,A,16-May-01,3-Sep-01 ??? ??? ??? ??? ??? 1,B,3-Sep-01,13-Sep-01 ??? ??? ??? ??? ??? 1,C,13-Sep-01,26-Feb-04 ??? ??? ??? ??? ???
2013 Aug 25
1
Capturing the whole output using R
Hi, May be this helps: #Creating some dummy data.? set.seed(24) lst1<-lapply(1:8,function(x) ts(sample(1:25,20,replace=TRUE))) set.seed(49) lst2<-lapply(1:8,function(x) ts(sample(1:45,20,replace=TRUE))) ??Find_Max_CCF() #No vignettes or demos or help files found with alias or concept or #title matching ?Find_Max_CCF? using regular expression matching. Found a function with the same
2013 Apr 18
6
count each answer category in each column
Hey, Is it possible that R can calculate each options under each column and return a summary table? Suppose I have a table like this: Gender Age Rate Female 0-10 Good Male 0-10 Good Female 11-20 Bad Male 11-20 Bad Male >20 N/A I want to have a summary table including the information that how many answers in each category, sth like this: X