Displaying 20 results from an estimated 20000 matches similar to: "matrix subsetting assignment with logical mask"
2003 Sep 10
4
recording and taking mean of a set of matrices
I'm looking for a good form in which to store matrix results of a
simulation.
I am doing a simulation study. Each simulation generates some data
and then analyzes it. I want to record the results of many
simulations and analyze them. Say r has the results of one
simulation, and I care about r$coefficients, a vector of coefficients,
and r$var, the estimated covariance matrix.
I'll do
2009 Dec 17
5
?setGeneric garbled (PR#14153)
Full_Name: Ross Boylan
Version: 2.10.0
OS: Windows XP
Submission from: (NULL) (198.144.201.14)
Some of the help for setGeneric seems to have been garbled. In the section
"Basic Use", 5th paragraph (where the example counts as a single line 3rd
paragraph) it says
<quote>
Note that calling 'setGeneric()' in this form is not strictly
necessary before calling
2013 Apr 05
2
model.frame: object is not a matrix
Over a decade ago there was a problem with model.frame when the variable
names were long:
https://stat.ethz.ch/pipermail/r-help/2002-August/024492.html
I have similar symptoms with R 2.15.3 on Windows 7:
Browse[2]> x <- model.matrix(formula(myform), p$data)
Error in model.frame.default(object, data, xlev = xlev) (from mice.R#601) :
object is not a matrix
My attempt at a work-around
2024 May 10
1
R CMD check vs RStudio check
Ivan, thank you for the tips; they allowed me to move on to the next problems.
By building the tar file first and checking it later, and fixing several other problems I got
R CMD check to work. It does *not* delete inst/doc. It also does not run boostrap.R,
as far as I can tell, presumably because only devtools does.
Check within RStudio continues to delete inst/doc, so this behavior is
2009 Aug 16
1
good and bad ways to import fixed column data (rpy)
Recorded here so others may avoid my mistakes.
I have a bunch of files containing fixed width data. The R Data guide
suggests that one pre-process them with a script if they are large.
They were 50MG and up, and I needed to process another file that gave
the layout of the lines anyway.
I tried rpy to not only preprocess but create the R data object in one
go. It seemed like a good idea; it
2015 Nov 19
2
Re: recovering corrupt file system
well, the next place to go, if fsck isn't enough would be to to try
debugfs(1)
man debugfs.
On Wed, Nov 18, 2015 at 8:39 PM, Boylan, Ross <Ross.Boylan@ucsf.edu> wrote:
> I guess some of the trouble was that the virtual disk was mounted
> read-only at the VM level. When I mounted read/write I was able to do
> fsck, which gave messages about replaying the logs and a couple
2015 Mar 20
1
Re: getting oriented/networking [some success]
I seem to have run into https://bugzilla.redhat.com/show_bug.cgi?id=855640, because when I tried the fix/work-around at the end (comment 11), ethtool -K eth0 gro off, my download speed by speedtest went from undetectable to ~150Mb/s. However, it was not able to connect for the upload test, and so something may still be off. Non-virtual machines can do the upload test, so it's not just a
2009 Jul 09
1
Converting indices of a matrix subset
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have two matrices:
> m1 <- matrix(1,4,4)
> m1
[,1] [,2] [,3] [,4]
[1,] 1 1 1 1
[2,] 1 1 1 1
[3,] 1 1 1 1
[4,] 1 1 1 1
> m2 <- matrix(0,3,3)
> diag(m2) <- 1
> m2
[,1] [,2] [,3]
[1,] 1 0 0
[2,] 0 1 0
[3,] 0 0 1
I want to get indicies from m2
2007 Nov 15
1
Why is model.matrix creating 2 columns for boolean?
I have a data frame "reading" that includes a logical variable "OLT"
along with response variable "Reading" and predictor "True" (BOTH are
numeric variables; it's "True" as in the true value).
When I suppress the intercept, model.matrix gives me OLTTRUE and
OLTFALSE columns. Why? Can I do anything to prevent it?
> r <-
2006 May 18
3
S4 classes and C
Is there any good source of information on how S4 classes (and methods)
work from C?
E.g., for reading
how to read a slot value
how to invoke a method
how to test if you have an s4 object
For writing, how to make a new instance of an S4 object.
I've found scattered hints in the archive, including a link to a talk on
this subject "I am using C code to create an S4 object based on
2006 Nov 15
1
tail recursion in R
Apparently Scheme is clever and can turn certain apparently recursive
function calls into into non-recursive evaluations.
Does R do anything like that? I could find no reference to it in the
language manual.
What I'm wondering is whether there are desirable ways to express
recursion in R.
Thanks.
--
Ross Boylan wk: (415) 514-8146
185 Berry St #5700
2006 Dec 07
2
making a grid of points
I'd like to evaluate a function at each point on a 2 or 3-D grid. Is
there some function that already does this, or generates the grid of
points?
My search has led me to the grid and lattice packages, and I found a
reference to the sp package (e.g., SpatialGrid) for this. There are
things in there that might be relevant, but at first blush many of them
are embedded in other concepts (grobs,
2006 Sep 26
3
S4 accessors
I have a small S4 class for which I've written a page grouping many of
the accessors and replacement functions together. I would be interested
in people comments on the approach I've taken.
The code has a couple of decisions for which I could imagine
alternatives. First, even simple get/set operations on class elements
are wrapped in functions. I suppose I could just use myinstance at
2016 Apr 22
2
S4 non-virtual class with no slots?
It seems that if an S4 class has no slots it can't be instantiated because it is assumed to be virtual. Is there a way around this other than adding a do-nothing slot? A singleton would be OK, though is not essential.
Problem:
EmptyFitResult <- setClass("EmptyFitResult", representation=representation())
# also tried it without the second argument. same result.
> e <-
2004 Feb 07
2
R does in memory analysis only?
I wonder if someone would confirm something I'm 99% sure of from the
docs and discussion on the list, but can't find stated explicitly:
R works only on problems that fit into (real or virtual) memory.
Thus, even if you have a problem (e.g., simple regression) that could be
solved by doing some operation on each row of a dataset at a time, you
can't solve it unless the entire dataset
2005 Aug 18
2
Use of contains in S4 classes
setClass("B", representation=representation("B", extra="numeric))
setClass("B", representation=representation(extra="numeric"),
contains="B")
Are these the same? If not, how do they differ?
What about
setClass("B", representation=representation("B", extra="numeric"),
contains="B")
?
As far as I can
2007 Jun 05
1
ggplot aspect ratio
Is there a way to control the aspect ratio of plots using ggplot?
Specifically, I'm using the formula=a~b argument to produce a grid of
plots, but the overall width of the result seems to vary for reasons
that are obscure to me.
This affects not only the appearance of the plots but the amount of
space available for the title (which seems to be right justified
relative to the right edge of the
2007 Feb 16
1
pinning down symbol values (Scoping/Promises) question
I would like to define a function using symbols, but freeze the symbols
at their current values at the time of definition. Both symbols
referring to the global scope and symbols referring to arguments are at
issue. Consider this (R 2.4.0):
> k1 <- 5
> k
[1] 100
> a <- function(z) function() z+k
> a1 <- a(k1)
> k1 <- 2
> k <- 3
> a1()
[1] 5
> k <- 10
>
2010 Jan 15
2
optional package dependency
I have a package that can use rmpi, but works fine without it. None of
the automatic test code invokes rmpi functionality. (One test file
illustrates how to use it, but has quit() as its first command.)
What's the best way to handle this? In particular, what is the
appropriate form for upload to CRAN?
When I omitted rmpi from the DESCRITPION file R CMD check gave
<quote>
* checking
2024 May 03
1
R CMD check vs RStudio check
? Fri, 3 May 2024 19:45:08 +0000
"Boylan, Ross via R-help" <r-help at r-project.org> ?????:
> & $R CMD check .
> * checking for file './DESCRIPTION' ... ERROR
> Required fields missing or empty:
> 'Author' 'Maintainer'
You're checking a source package directory. This could work, but it's
much easier and more reliable to (1) build