Displaying 20 results from an estimated 7000 matches similar to: "as.list method for by Objects"
2018 Jan 30
2
as.list method for by Objects
Dario,
What version of R are you using. In my mildly old 3.4.0 installation and in
the version of Revel I have lying around (also mildly old...) I don't see
the behavior I think you are describing
> b = by(1:2, 1:2, identity)
> class(as.list(b))
[1] "list"
> sessionInfo()
R Under development (unstable) (2017-12-19 r73926)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
2018 Jan 30
2
as.list method for by Objects
by() does not always return a list. In Gabe's example, it returns an
integer, thus it is coerced to a list. as.list() means that it should be a
VECSXP, not necessarily with "list" in the class attribute.
Michael
On Tue, Jan 30, 2018 at 2:41 PM, Herv? Pag?s <hpages at fredhutch.org> wrote:
> Hi Gabe,
>
> Interestingly the behavior of as.list() on by objects seem to
2018 Jan 30
2
as.list method for by Objects
I just meant that the minimal contract for as.list() appears to be that it
returns a VECSXP. To the user, we might say that is.list() will always
return TRUE. I'm not sure we can expect consistency across methods beyond
that, nor is it feasible at this point to match the semantics of the
methods package. It deals in "class space" while as.list() deals in
"typeof() space".
2018 Feb 01
2
as.list method for by Objects
>>>>> Michael Lawrence <lawrence.michael at gene.com>
>>>>> on Tue, 30 Jan 2018 10:37:38 -0800 writes:
> I agree that it would make sense for the object to have c("by", "list") as
> its class attribute, since the object is known to behave as a list.
Well, but that (list behavior) applies to most non-simple S3
classed
2018 Sep 20
3
A different error in sample()
Good day,
The use of "rounding" also doesn't make sense. If The number is halfway between two integers, it is rounded to the nearest even integer.
> round(2.5)
[1] 2
--------------------------------------
Dario Strbenac
University of Sydney
Camperdown NSW 2050
Australia
2018 Jan 30
0
as.list method for by Objects
On 01/30/2018 02:50 PM, Michael Lawrence wrote:
> by() does not always return a list. In Gabe's example, it returns an
> integer, thus it is coerced to a list. as.list() means that it should be
> a VECSXP, not necessarily with "list" in the class attribute.
The documentation is not particularly clear about what as.list()
means for list derivatives. IMO clarifications
2018 Jan 30
0
as.list method for by Objects
Hi Gabe,
Interestingly the behavior of as.list() on by objects seem to
depend on the object itself:
> b1 <- by(1:2, 1:2, identity)
> class(as.list(b1))
[1] "list"
> b2 <- by(warpbreaks[, 1:2], warpbreaks[,"tension"], summary)
> class(as.list(b2))
[1] "by"
This is with R 3.4.3 and R devel (2017-12-11 r73889).
H.
On 01/30/2018 02:33 PM,
2016 Feb 20
2
R Package Installation Ignores libPaths Setting
Good day,
I believe from the documentation that folders in R_LIBS should appear in the output of .libPaths, but they do not. The documentation contains "The library search path is initialized at startup from the environment variable R_LIBS ..."
However,
$ export R_LIBS=/users/stgrad/dario/tmp/
$ Rscript -e ".libPaths()"
[1] "/dskh/nobackup/biostat/Bioconductor"
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
2017 Feb 10
3
Grapics Device Resolution Limits
Good day,
Could the documentation of graphics devices give some explanation of how big the bitmap limits are? For example,
> png("Figure1A.png", h = 7, w = 7, res = 1000, units = "cm")
Results in Error: unable to start png() device, but the help page of devices doesn't explain that there are any limits or how they are determined. The wording of the error message could
2018 Jun 14
2
makeCluster Stall on 32-bit Windows
Good day,
I'm trying the example cl <- makeCluster(2, type = "SOCK") from the makeCluster documentation and the R command prompt never returns. I am using a 32-bit Windows 10 computer. The problem doesn't happen on another 64-bit Windows 10 computer but does happen on another 32-bit Windows 7 computer. Can anyone reproduce it? Are there any other options that can be passed to
2018 Jan 30
0
as.list method for by Objects
I agree that it makes sense to expect as.list() to perform
a "strict coercion" i.e. to return an object of class "list",
*even* on a list derivative. That's what as( , "list") does
by default:
# on a data.frame object
as(data.frame(), "list") # object of class "list"
# (but strangely it drops the names)
2015 Dec 30
2
Default R Font Changed After Upgrade to Debian 8
Good day,
I have been unable to solve this issue. Do you get grainy fonts when running the test case
plot(1:10, main = "abcedfghijklmnopqrstuvwxyz", cex.main = 4, cex.lab = 4, cex.axis = 4)
What version of libcairo is on your system ?
--------------------------------------
Dario Strbenac
PhD Student
University of Sydney
Camperdown NSW 2050
Australia
2018 Jul 19
2
Library lib.loc Option Ignored for Dependencies
Good day,
If there's a library folder of the latest R packages and a particular package from it is loaded using the lib.loc option, the dependencies of that package are still attempted to be loaded from another folder of older packages specified by R_LIBS, which may cause errors about version requirements not being met. The documentation of the library function doesn't explain what the
2018 Feb 08
2
sparse.model.matrix Generates Non-Existent Factor Levels if Ord.factor Columns Present
Good day,
Sometimes, sparse.model.matrix outputs a dgCMatrix which has column names consisting of factor levels that were not in the original dataset. The first factor appears to be correctly transformed, but the following factors don't. For example:
diamonds <- as.data.frame(ggplot2::diamonds)
> colnames(sparse.model.matrix(~ . -1, diamonds))
[1] "carat"
2013 Oct 04
2
Tab Separated File Reading Error
Hello,
I have a seemingly simple problem that a tab-delimited file can't be read in.
> annoTranscripts <- read.table("matched.txt", sep = '\t', stringsAsFactors = FALSE)
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 5933 did not have 12 elements
However, all lines do have 12 columns.
> lines <-
2018 Jul 24
4
Library lib.loc Option Ignored for Dependencies
>>>>> Benjamin Tyner
>>>>> on Sat, 21 Jul 2018 13:42:43 -0400 writes:
> Not sure whether it is the same issue as was raised here:
> https://stat.ethz.ch/pipermail/r-devel/2010-October/058729.html
> but in any case perhaps the problem could partially be remedied on line
> 245 of src/library/base/R/library.R by passing the lib.loc to
2018 Jul 21
3
Library lib.loc Option Ignored for Dependencies
>>>>> Benjamin Tyner
>>>>> on Fri, 20 Jul 2018 19:42:09 -0400 writes:
> Here's a trick/workaround; if lib.loc is the path to your
> library, then prior to calling library(),
>> environment(.libPaths)$.lib.loc <- lib.loc
Well, that is quite a "trick" -- and potentially a pretty
dangerous one, not intended when making
2014 Jul 18
1
capture.output on S4 slot
Hello,
capture.output produces a different result if the S4 object was created with a constructor than if the body of the constructor is copied and pasted.
setClass("TransformParams", representation(
transform = "function",
otherParams = "list")
)
setGeneric("TransformParams", function(transform, ...)
{standardGeneric("TransformParams")})
2017 Feb 10
2
Grapics Device Resolution Limits
Note that there are at least 5 separate png() devices, so Linux was not
using the (default) device used on Windows.
In general, the device-limits info is not on the help page because we do
not know it. On Windows the default device limits depend on the OS
version, 32/64-bit, RAM and the graphics hardware. This sounds like the
last: you were asking for 49 megapixels which is far larger than