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 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
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 +
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
- - --
-
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
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
2013 Apr 28
1
Hello. PLEASE HELP
I am a student of NTNU-Norway.
I have some issues in fitting an AR-GARCH with seasonal components.
My AR model contains the terms AR(1), AR(5), AR(20) and AR(60) and a
simple GARCH(1,1) model.
I received lot of errors when trying to do this.
Can you please provide me the source code of fitting such model to my data?
Best Regards
Ampem.
2006 Aug 03
2
efficient way to make NAs of empty cells in a factor (or character)
Dear all,
I have some csv-files (originating from Excel-files) containing empty
cells. In my example file I have four variables of different classes,
each with some empty cells in the original csv-file:
> test <- read.csv2("test.csv", dec=".")
> test
id id2 x y
1 a 1 NA
2 b e NA 2.2
3 f 3 3.3
4 c g 4 4.4
> class(test$id)
[1]
2018 Nov 29
2
named arguments discouraged in `[.data.frame` and `[<-.data.frame`
Thanks Bill and Michael for taking the time to share your knowledge!
As a further background to my question, here are two examples that I forgot to include in my original post (reminded by Michael's answer). I swapped the i and j arguments in `[.data.frame` and `[<-.data.frame`. With warnings, but else without (?) problem. Using Bill's data:
`[.data.frame`(x = d, i = 1, j = 2)
# [1]
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.
2013 Mar 11
3
New Stack
Hi Experts, I am newbie in R. Could you please share your idea to create a stack with no value or zero value? Nrow=1,Ncol=1, Ncell=1, I aim to work with looping, I want to make a first layer with zero values to add other layers further. Thanks.
Best Regards,
..................Anup KhanalNorwegian Institute of science and Technology (NTNU)Trondheim, NorwayMob:(+47) 45174313
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
2010 Feb 04
1
Bug in as.character? (PR#14206)
A long formula which is converted using as.character, looses its last
part: ``diagonal = 1e-12)''
Shorter formula is ok though.
Best,
H??vard
************
Browse[2]> formula.str
y ~ -1 + b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 +
b12 + b13 + b14 + b15 + b16 + b17 + b18 + b19 + b20 + b21 +
b22 + b23 + b24 + b25 + b26 + b27 + b28 + b29 + b30 + b31 +
b32 +
2009 Dec 17
2
Wrong links in help help files? (PR#14155)
Dear R developers,
?help.search
...opens a tab in my browser (Firefox 3.5.6, Win XP):
http://127.0.0.1:31642/library/utils/html/help.search.html
When I click on the link for "?",
(http://127.0.0.1:31642/library/utils/help/?)
in the last line of "Details", I get an error message:
"Server error: invalid response from R".
Similarly,
The link to "??"