similar to: Extracting selected rows from a matrix

Displaying 20 results from an estimated 8000 matches similar to: "Extracting selected rows from a matrix"

2011 Apr 13
1
Extracting selected rows from a matrix to a submatix
I have a matrix M > dim(M) [1] 30380   561 I have another list L contains , that contains some row names of matrix M str (L)  chr [1:21037] Now I want to extract the submatrix subM (21037    ,    561)  from the matrix M by matching the rownames (M) to the 21037 rownames o f L How do I do that ? Thanks and regards, Pankaj Barah   Pankaj Barah Department of Biology  Norwegian University
2011 Feb 08
2
Extrcat selected rows from a list
Hi, I have two lists 1) List1- 30,000 rows and 104 columns 2) List2- a list of 14000 selected rownames  from List 1 Now, I want to extract all the 104 columns of List1  matching with the 14000 selected rownames from List2.  Psedocode will be something like this: match rownames(List2) with rownames(List1) extract selected matched 104 coloumns from (List1) strore in-> List3 So the
2011 Apr 12
2
Merge matrix
I have two matrices A and B > dim (A) [1] 30380   104 > dim(Bt) [1] 30380    63 I want to  combine both A and B to matrix C where >dim(C) [1] 30380   167 How do I do that ? Regards, Pankaj Barah Department of Biology, Norwegian University of Science & Technology (NTNU) Realfagbygget, N-7491 [[alternative HTML version deleted]]
2009 Jan 02
1
[Fwd: Re: [R] Randomly remove condition-selected rows from a matrix]
Following Duncan's suggestion, I forward the below to R-devel. vQ -------- Original Message -------- Subject: Re: [R] Randomly remove condition-selected rows from a matrix Date: Fri, 02 Jan 2009 10:34:52 -0500 From: Duncan Murdoch <murdoch at stats.uwo.ca> To: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> CC: R help <R-help at stat.math.ethz.ch>
2009 Nov 16
1
extracting values from correlation matrix
Hi! All, I have 2 correlation matrices of 4000x4000 both with same row names and column names say cor1 and cor2. I have extracted some information from 1st matrix cor1 which is something like this: rowname colname cor1_value a b 0.8 b a 0.8 c f 0.62 d k 0.59 - - -- -
2009 Aug 24
2
Number of CPU's
Any way to get access to the number of CPU's, optionally their type, from within R? In linux I can just read /proc/cpuinfo but for win/mac ? Thanks! H?vard -- H?vard Rue Department of Mathematical Sciences Norwegian University of Science and Technology N-7491 Trondheim, Norway Voice: +47-7359-3533 URL : http://www.math.ntnu.no/~hrue Fax : +47-7359-3524 Email: havard.rue
2008 Oct 26
4
odd behaviour of identical
given what ?identical says, i find the following odd: x = 1:10 y = 1:10 all.equal(x,y) [1] TRUE identical(x,y) [1] TRUE y[11] = 11 y = y[1:10] all.equal(x,y) [1] TRUE identical(x,y) [1] FALSE y [1] 1 2 3 4 5 6 7 8 9 10 length(y) [1] 10 looks like a bug. platform i686-pc-linux-gnu arch i686 os linux-gnu system
2003 Feb 05
3
R as a `script'
is there any way i can use R as a tool for scripts in unix, as wotan[hrue]$ cat example.R #!/usr/bin/R x=1 havard -- Havard Rue Department of Mathematical Sciences Norwegian University of Science and Technology N-7491 Trondheim, Norway Voice: +47-7359-3533 URL : http://www.math.ntnu.no/~hrue Fax : +47-7359-3524 Email: havard.rue at math.ntnu.no
2011 Aug 26
2
Extracting values in table
Hi All, I am a beginner in programming in r and please do forgive me if my question seems to be silly and sometimes not understandable. 1. we have a list of elements in a list say: ls<-list("N","E","E","N","P","E","M","Q","E","M") 2. We have an another list of tables in a list say: n <-
2005 Nov 25
1
Use of nesting in lmer- error in numerical expression
Dear R users, I am trying to fit a GLMM using lmer to a dataset where the brood identity (LNRREIR) is nested within mothers identity. The reason for this is that each mother can have several nests within each year and also between years. I am running the following script (actually I have tried all different combinations with LNRREIR and mother): mod <- lmer(sr~z.hatchday +
2017 Sep 20
0
arguments imply differing number of rows
4000:6000 gives you 4000, 4001, ..., 6000. I suspect you want population= c(seq(4000, 6000, length=5), seq(3500, 4300, length=5), seq(3000, 3200, length=5)) Bob On 20 September 2017 at 17:07, Shivi Bhatia <shivipmp82 at gmail.com> wrote: > Hi Team, > > I using the syntax as: > > data.df<- data.frame( > city= c(rep(c("Delhi",
2013 Feb 23
1
Extract, sum and Loop in R
Hi all, I have gone through some basics of R in eclipse environment. What I need to work is more than basic level so I could not find out the solution by myself. could anyone help me ? My case, I have climate data (precipitation) in nc format with single layer for each time interval in a day. That means for January 1, 2013, I have 8 separate files each containing 3 hrs cumulative precipitation
2009 Jul 13
2
how to keep row name if there is only one row selected from a data frame
Hi, there: Assume I have a dataframe with rownames like A with rownames like a to e, > A [,1] [,2] a 1 6 b 2 7 c 3 8 d 4 9 e 5 10 when I use A[1,], I lost the rowname for it, like below. How could I keep it? Is there an easy way instead that I have to modify by myself after I used A[1,] manually. > A[1,] [1] 1 6 Thanks, W. -- Weiwei Shi, Ph.D Research
2008 Jun 18
1
strsplit and the empty string
Hello, I am wondering about the behaviour of strsplit. When the pattern matches the beginning of the search string, the mepty string is added to the result, but that's not the case when the pattern matches the end of the search string: strsplit(" hello dolly ") [1] "" "hello" "dolly" The man for strsplit explains the algorithm: " The algorithm
2008 May 19
2
Sort matrix with duplicate row names alphabetically by rowname
Hi, I've a matrix that contains 4 replicates of each rowname. (4 a's, 4 b's, 4 c's in no particular order) Like this: # c 32 a 1 b 4 c 87 c 34 b 54 a 23 a 12 b 9 a 3 b 87 c 43 There are a couple of more columns but I'm using the above as an example I need to sort it so that the same rownames appear together in alpahbetical order. Like this: # a 1 a 23 a 12 a 3 b 4
2008 Jan 11
2
Virtually deleting rows from tables
I dont want to delete the records from my tables but just set a column is_deleted to true. What is the best (clean)way to implement this? Is there any way of defining a model which includes only a set of records which satisfy a certain conditions.eg a condition to include the records for which is_deleted is false some thing like this def User << ActiveRecord::Base :conditions=>
2009 Mar 22
5
If statement generates two outputs
Hi, How do I tell an if statement to generate two seperate outputs. E.g If X>5 I want to create df1 and df2: if (X>5) {df1<-c(4,5,6,7,8) AND df2<-c(9,10,11,12,13)} Thanks, James -- View this message in context: http://www.nabble.com/If-statement-generates-two-outputs-tp22650844p22650844.html Sent from the R help mailing list archive at Nabble.com.
2006 Aug 08
0
(Fwd) Re: paired t-test. Need to rearrange data?
------- Forwarded message follows ------- From: Petr Pikal <petr.pikal at precheza.cz> To: Henrik Parn <henrik.parn at bio.ntnu.no> Subject: Re: [R] paired t-test. Need to rearrange data? Date sent: Tue, 08 Aug 2006 16:13:47 +0200 Hi Uff, it takes me a bit headache but this shall do it ?unstack ?table ?t new.list<-unstack(test.data,y~id)
2012 Oct 21
1
Changing a for loop to a function using sapply
Apparently there is one or more concepts that I do not fully understand from the descriptions of a function and the apply material. I have been reading the mail from this forum and have learned much but, in this case, what I have been reading here and from the manual isn't enough. The following code produces what I want with the for loop. From what I have read from this forum, a for
1998 Aug 24
1
R-beta: Segmentation fault
Dear everyone, I'm doing some simulations which involves bootstrapping (using functions written in c loaded with R's dyn.load() function) and maximising the likelihood function with R's nlm() function. I used to run my code in S-plus but because I frequently ran out of memory (because of S-plus' silly memory management), I decided to try porting my code to R. In R (on a linux