Displaying 9 results from an estimated 9 matches for "beniltoncarvalho".
2012 Feb 18
4
assigning NULL to a list element
Hi everyone,
For reasons beyond the scope of this message, I'd like to append a
NULL element to the end of a list.
tmp0 <- list(a=1, b=NULL, c=3)
append(tmp0, c(d=4)) ## works as expected
append(tmp0, c(d=NULL)) ## list with a/b/c only
Given that I could use
tmp0$a <- NULL
to remove 'a', I seem to understand why appending NULL returns me the
original list... But how should I
2012 Mar 09
1
extracting the i-th row of a matrix in a list of lists
Hi,
what is the proper of of "passing a missing value" so I can extract
the entire i-th row of a matrix (in a list of lists) without
pre-computing the number of cols?
For example, if I know that the matrices have 2 columns, I can do the following:
set.seed(1)
x0 <- lapply(1:10, function(i) replicate(4, list(matrix(rnorm(10), nc=2))))
lapply(lapply(x0, '[[', 3), '[',
2012 Mar 11
2
Efficient access to elements of a list of lists
Hi,
I have a long list of lists from which I want to efficiently extract
and rbind elements. So I'm using the approach below:
f <- function(i){
out <- replicate(5, list(matrix(rnorm(80), nc=20)))
names(out) <- letters[1:5]
out
}
set.seed(1)
lst <- lapply(1:1.5e6, f)
(t0 <- system.time(tmp <- do.call(rbind, lapply(lst, '[[', 'b'))))
Is there
2012 Jul 07
1
creating a '[' method for an S4 class
Hi,
I'm working on an S4 class that is expected to behave like an array.
I have some difficulties when defining '[' and I wonder if someone
could point me to the right direction:
1) Call the S4 object "obj"
2) Assume dim(obj) = c(10, 4, 2)
3) Suppose someone calls: obj[1:3,] , which is a mistake, given
dim(obj); how do I detect such situations?
Thank you very much for
2012 Mar 26
2
read.csv and field containing single quotes
I need to read in csv files, created by 3rd party, with fields
containing single quotes (as shown below).
"header1","header2","header3","header4"
"field1r1","field2r1","field3r1","field4r1"
"field1r2","field2r2","field3r2PartA), field3r2PartB Very" Long","field4r2"
2010 Mar 24
0
R-help ordinal regression
...http://n4.nabble.com/using-a-list-to-index-elements-of-a-list-tp1679184p1679184.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 29
> Date: Tue, 23 Mar 2010 15:10:45 +0000
> From: Benilton Carvalho <beniltoncarvalho at gmail.com>
> To: Pj253 <pj253 at cam.ac.uk>
> Cc: r-help at r-project.org
> Subject: Re: [R] using a list to index elements of a list
> Message-ID:
> ??? <e71a39ea1003230810k445d0d06j87a240986b40af95 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859...
2010 Feb 03
1
can't launch R after "installing" it
Hi everyone,
I'm writing on behalf of a friend who's got a Ubuntu 9.04 system.
After an apparent successful installation of R (via sudo apt-get
install r-base), her attempts of loading R (typing 'R' on the
terminal) always return a message stating that it is not installed.
Since I'm no expert on Ubuntu nor on its package manag. system and,
additionally, I failed on finding
2011 Mar 01
1
changes in recent R-devel revisions?
Hi,
I have a BioC infra-structure package that works fine (I can build,
check and load it successfully) on revision r53950. The very same
package fails on r54591 with the error below:
Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source
= keep.source) :
cyclic name space dependency detected when loading ?oligoClasses?,
already loading ?oligoClasses?
I don't see anything
2012 Jun 05
1
length-0 list as dimnames
Hi,
I'm working on a package and observed a behaviour that was suggested
to be incompatible with the documentation.
The code below:
x <- matrix(1:4, 2)
dimnames(x) <- list()
works just fine. But checking the documentation for dimnames(), it
states that if value is a list "its components are either 'NULL' or a
character vector with positive length of the appropriate