Displaying 20 results from an estimated 48 matches for "s4vector".
Did you mean:
s4vectors
2016 Jun 26
2
3 minor issues with getClass 'resolve.msg' arg
Hi,
It turns out that two packages (1 Bioconductor, 1 CRAN) define an
S4 class called "Annotated":
library(S4Vectors) # see (*) at bottom for how to install
library(RNeXML)
1st issue
---------
getClass() issues the same warning twice:
tmp <- getClass("Annotated")
Found more than one class "Annotated" in cache; using the first, from
namespace 'S4Vectors'
Found more...
2016 Jul 11
0
3 minor issues with getClass 'resolve.msg' arg
>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>> on Sun, 26 Jun 2016 13:21:00 -0700 writes:
> Hi,
> It turns out that two packages (1 Bioconductor, 1 CRAN) define an
> S4 class called "Annotated":
> library(S4Vectors) # see (*) at bottom for how to install
> library(RNeXML)
> 1st issue
> ---------
> getClass() issues the same warning twice:
> tmp <- getClass("Annotated")
> Found more than one class "Annotated" in cache; using the first, from...
2018 Jun 08
1
Subsetting the "ROW"s of an object
On 06/08/2018 10:15 AM, Michael Lawrence wrote:
> There probably should be an abstraction for this. In S4Vectors, we
> have extractROWS().
FWIW the code in S4Vectors that does what your subset_ROW() does is:
https://github.com/Bioconductor/S4Vectors/blob/04cc9516af986b30445e99fd1337f13321b7b4f6/R/subsetting-utils.R#L466-L476
(This is the default "extractROWS" method.)
Except for the normal...
2016 Feb 18
2
R Package Installation Ignores libPaths Setting
Good day,
If the library path is changed with .libPaths, the command
install.packages("/nb/dario/Biostrings_2.39.9.tar.gz", repos=NULL)
fails with
** testing if installed package can be loaded
Error : package ?S4Vectors? required by ?Biostrings? could not be found
However,
running library(S4Vectors) followed by sessionInfo() after the error shows that the package can indeed be found by R
R version 3.2.3 Patched (2016-02-14 r70170)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie...
2005 Jan 14
1
S3/S4 classes performance comparison
...ses
setClass("S4content",representation(content="ANY",add1="ANY",add2="ANY",type="character"))
S4content <- function(obj=NULL,add1=NULL,add2=NULL,type="",...){
new("S4content",content=obj,add1=add1,add2=add2,type=type)
}
S4vector <- function(vec,...){
new("S4content",type="vector",content=vec,...)
}
### Now the test
> test <- rnorm(10000)
> gc()
used (Mb) gc trigger (Mb)
Ncells 169135 4.6 531268 14.2
Vcells 75260 0.6 786432 6.0
> (system.time(lapply(test,S3vect...
2019 Jul 08
1
Format printing inside a matrix
...splaying an object in a cell would be a reasonable
solution for this particular problem. However, as soon as you start
treating these objects as data (like putting them into a matrix),
you're likely going to want vectorized operations over them, which
means formalized vector and matrix classes. S4Vectors in Bioconductor
facilitates this for vectors, but not for higher-order arrays.
Michael
On Sun, Jul 7, 2019 at 4:44 PM Abby Spurdle <spurdle.a at gmail.com> wrote:
>
> > I am not sure if there is an existing solution to this, but I want my S4
> > objects inside a list matrix...
2017 Jun 27
0
paste strings in C
To do this in C, it would probably be easier and faster to just do the
string manipulation directly. Luckily, there are already packages that
have done this for you. See an example below using the S4Vectors
package.
foo2 <- function(mymat, colnms, tilde=FALSE) {
chars <- colnms[col(mymat)]
lowerChars <- if (tilde) paste0("~", chars) else tolower(chars)
chars <- ifelse(mymat==1L, lowerChars, chars)
keep <- mymat > 0L
charList <- split(chars[keep], ro...
2017 Jun 27
2
paste strings in C
Dear R-devs,
Below is a small example of what I am trying to achieve, that is trivial in
R and I would like to learn how to do in C, for very large matrices:
> (mymat <- matrix(c(1,0,0,2,2,1), nrow = 2))
[,1] [,2] [,3]
[1,] 1 0 2
[2,] 0 2 1
And I would like to produce:
[1] "a*C" "B*c"
Which can be trivially done in R via something like:
foo
2015 Oct 07
1
Error generated by .Internal(nchar) disappears when debugging
...0-17
[5] gsl_1.9-10 mvtnorm_1.0-3 grid_3.2.0 stats4_3.2.0
[9] lattice_0.20-31 stabledist_0.7-0 fortunes_1.5-2
On Wed, Oct 7, 2015 at 9:52 PM, Cook, Malcolm <MEC at stowers.org> wrote:
> What other packages do you have loaded? Perhaps a BioConductor one that
> loads S4Vectors that announces upon load:
>
> Creating a generic function for 'nchar' from package 'base' in
> package 'S4Vectors'
>
> Maybe a red herring...
>
> ~Malcolm
>
> > -----Original Message-----
> > From: R-devel [mailto:r-devel-bounce...
2018 Jun 08
6
Subsetting the "ROW"s of an object
Hi all,
Is there a better to way to subset the ROWs (in the sense of NROW) of
an vector, matrix, data frame or array than this?
subset_ROW <- function(x, i) {
nd <- length(dim(x))
if (nd <= 1L) {
x[i]
} else {
dims <- rep(list(quote(expr = )), nd - 1L)
do.call(`[`, c(list(quote(x), quote(i)), dims, list(drop = FALSE)))
}
}
subset_ROW(1:10, 4:6)
#> [1] 4 5 6
2015 Oct 07
0
Error generated by .Internal(nchar) disappears when debugging
What other packages do you have loaded? Perhaps a BioConductor one that loads S4Vectors that announces upon load:
Creating a generic function for 'nchar' from package 'base' in package 'S4Vectors'
Maybe a red herring...
~Malcolm
> -----Original Message-----
> From: R-devel [mailto:r-devel-bounces at r-project.org] On Behalf Of Duncan
> Murdoch...
2016 Feb 18
0
R Package Installation Ignores libPaths Setting
...07:00, Dario Strbenac wrote:
> Good day,
>
> If the library path is changed with .libPaths, the command
>
> install.packages("/nb/dario/Biostrings_2.39.9.tar.gz", repos=NULL)
>
> fails with
>
> ** testing if installed package can be loaded
> Error : package ?S4Vectors? required by ?Biostrings? could not be found
>
> However,
>
> running library(S4Vectors) followed by sessionInfo() after the error shows that the package can indeed be found by R
>
> R version 3.2.3 Patched (2016-02-14 r70170)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Runn...
2015 Oct 05
9
Error generated by .Internal(nchar) disappears when debugging
On 05/10/2015 7:24 PM, Matt Dowle wrote:
> Joris Meys <jorismeys <at> gmail.com> writes:
>
>>
>> Hi all,
>>
>> I have a puzzling problem related to nchar. In R 3.2.1, the internal
> nchar
>> gained an extra argument (see
>> https://stat.ethz.ch/pipermail/r-announce/2015/000586.html)
>>
>> I've been testing code using the
2015 Jan 23
0
issue with update.packages()
...i :
Version 1.0 installed in /Library/Frameworks/R.framework.develMav/Versions/3.2/Resources/library
Version 1.29.17 available at http://bioconductor.org/packages/3.1/bioc
Update (y/N/c)? y
also installing the dependencies ?IRanges?, ?BiocGenerics?, ?Biobase?, ?GenomeInfoDb?, ?DBI?, ?RSQLite?, ?S4Vectors?
trying URL 'http://bioconductor.org/packages/3.1/bioc/src/contrib/IRanges_2.1.35.tgz'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'http://bioconductor.org/packages/3.1/bioc/src/contrib/IRanges_2.1.35.tgz'
In addition: Warning mes...
2018 Jun 26
3
list of methods
I recently got a request to add head() and tail() methods for Surv objects, which is quite
reasonable, but not unlike other requests for logLik,? vcov, extractAIC, ...?? What they
all have in common is that are methods added since creation of the survival package, and
that I didn't know they existed.
To try and get ahead of the curve, is there a way to list names of all of the default
2015 Jan 24
3
Proper way to define cbind, rbind for s4 classes in package
Hi all,
this question has already been posted on stackoverflow, however without
success, see also
http://stackoverflow.com/questions/27886535/proper-way-to-use-cbind-rbind-with-s4-classes-in-package.
I have written a package using S4 classes and would like to use the
functions rbind, cbind with these defined classes.
Since it does not seem to be possible to define rbind and cbind directly
as S4
2019 Jul 23
3
Any plans for ALTREP lists (VECSXP)?
...having done super much in the way of benchmarking). What exactly is
as.altrep doing?
Best,
~G
On Tue, Jul 23, 2019 at 9:54 AM Michael Lawrence via R-devel <
r-devel at r-project.org> wrote:
> Hi Kylie,
>
> As an alternative in the short term, you could consider deriving from
> S4Vector's List class, implementing the getListElement() method to
> lazily create the objects.
>
> Michael
>
> On Tue, Jul 23, 2019 at 9:09 AM Bemis, Kylie <k.bemis at northeastern.edu>
> wrote:
> >
> > Hello,
> >
> > I was wondering if there were any pla...
2015 Jan 26
2
Proper way to define cbind, rbind for s4 classes in package
...thods (see ?cBind) I defined
>> rbind2 and cbind2 instead:
>>
> This needs some clarification. It certainly is possible to
> define cbind and rbind methods. The BiocGenerics package
> defines generics for those and many methods are defined by
> e.g. S4Vectors, IRanges, etc. The issue is that dispatch
> on "..." is singular, i.e., you can only specify one class
> that all args in "..." must share (potentially through
> inheritance).
> Thus, trying to combine objects from a
> different hierarchy (o...
2019 Jul 24
1
[External] Re: Any plans for ALTREP lists (VECSXP)?
...t; Best,
> > ~G
> >
> > On Tue, Jul 23, 2019 at 9:54 AM Michael Lawrence via R-devel <
> > r-devel at r-project.org> wrote:
> >
> >> Hi Kylie,
> >>
> >> As an alternative in the short term, you could consider deriving from
> >> S4Vector's List class, implementing the getListElement() method to
> >> lazily create the objects.
> >>
> >> Michael
> >>
> >> On Tue, Jul 23, 2019 at 9:09 AM Bemis, Kylie <k.bemis at northeastern.edu>
> >> wrote:
> >>>
> >>...
2020 May 24
2
paste(character(0), collapse="", recycle0=FALSE) should be ""
...will universally adopted
in R 11.0.0 ;-)
So if we have to do with what we have IMO (1) is the scheme that makes
most sense although I agree that it can do some surprising things for
some unusual combinations of vector lengths. It's the scheme I adhere to
in my own binary operations e.g. in S4Vector::pcompare().
The modest proposal of the 'recycle0' argument is only to let the user
switch from recycling scheme (2) to (1) if they're not happy with scheme
(2) (I'm one of them). Switching to scheme (3) or to a new custom scheme
would be a completely different proposal.
>...