Displaying 20 results from an estimated 20000 matches similar to: "factor matrix"
2003 Jun 16
2
extension to plot.formula?
Could I suggest the following extension to plot.formula:
plot(cbind(y1,y2) ~ x, ...)
should plot (y1 against x) and (y2 against x) on the same plot.
The default y axis limits would be determined by the range of c(y1,y2).
This would be pretty handy sometimes, replacing 4 lines of code.
The current plot.formula evaluates cbind(y1,y2), which is a matrix,
so plot.formula looks for
2005 Jun 03
2
dot in formula
gReetings,
I want to manipulate a formula object, containing the name "."
so that "." is replaced by a desired (arbitrary) expression.
What is a safe way to do this?
Adrian Baddeley
2009 Dec 17
2
segfault in glm.fit (PR#14154)
Bug summary:
glm() causes a segfault if the argument 'data'
is a data frame with more than 16384 rows.
Bug demonstration:
-------input ---------------
N <- 16400
df <- data.frame(x=runif(N, min=1,max=2),y=rpois(N, 2))
glm(y ~ x, family=poisson, data=df)
------ output ---------------
*** caught segfault ***
address (nil),
2003 Aug 06
1
contour lines intersect
Hi,
Sorry if this is already known...
contour() sometimes draws contour lines that intersect.
Is there a temporary fix?
A dataset which causes problems is at
http://www.maths.uwa.edu.au/~adrian/dumpdata.R
If you try just
source("dumpdata.R")
image(huh)
contour(huh)
the 100 x 100 matrix 'huh' contains an hourglass-shaped region
of values around 0.8. The contour plot
2005 Feb 07
2
Environment of a formula
Wise and merciful R-helpers:
I want to equip a data frame with an attribute
which specifies how to plot some of the columns.
Up to now we have been doing this by giving the data frame
a `formula' attribute, that can be passed to plot.formula.
For example
dat <- data.frame(x=1:100,y=runif(100),z=100:1)
attr(dat, "plotme") <- (z ~ x)
......
......
2013 Sep 19
1
Vignette problem and CRAN policies
Hello, All:
The vignette with the sos package used "upquote.sty", required for R
Journal when it was published in 2009. Current CRAN policy disallows
"upquote.sty", and I've so far not found a way to pass "R CMD check"
with sos without upquote.sty.
I changed sos.Rnw per an email exchange with Prof. Ripley without
solving the problem; see below. The
2007 Aug 22
1
C code generators
Dear R-helpers
Are there any established R packages that include a C code generator --
that generates new C language files and compiles them?
To be precise what I'm looking for is a process that takes text input in
some format (it might be pseudocode, fragments of C code, etc) and creates
a valid C language source file that can be compiled by R CMD COMPILE.
Ideally the procedure should also
2005 Aug 03
2
hash code for arbitrary object
Can anyone suggest a simple way to calculate a 'hash code'
from an arbitrary R object?
hash(x) should return an integer or string
with the property that
if hash(x) != hash(y) then x and y are not identical
and the time to compute hash(x) should be quite short.
Any suggestions welcome
thanks
Adrian Baddeley
2014 Jul 30
2
listof
Dear R developers
A question about the class 'listof', defined in package 'stats'.
Other than its definition and use in the code for 'anova',
we can't see that the class 'listof' is used for anything else
(in recommended packages, or elsewhere).
In the spatstat package we have been using a 'listof'
to represent a list of spatial objects of the same
2005 Jan 27
7
getting package version inside .First.lib
Greetings -
Is it possible, inside .First.lib,
to find out the version number of the package that is being loaded?
If only one version of the package has been installed,
we could scan the DESCRIPTION file, something like
.First.lib <- function(lib, pkg) {
library.dynam("spatstat", pkg, lib)
dfile <- system.file("DESCRIPTION", package="spatstat")
2001 Aug 01
1
glm() with non-integer responses
A question about the inner workings of glm() and dpois():
Suppose I call
glm(y ~ x, family=poisson, weights = w)
where y contains NON-INTEGER (but still nonnegative) values.
(a) Does glm() still correctly maximise
the weighted Poisson loglikelihood ?
(i.e. the function given by the same formal expression as the
weighted loglikelihood of independent Poisson variables Y_i
except that the
2001 Aug 10
1
bug in dummy.coef.lm? (PR#1048)
Hi -
I'm running R 1.3.0 on i686-pc-linux-gnu
> rm(x, y, z)
> df <- data.frame(x=1:20,y=1:20,z=factor(1:20 <= 10))
dummy.coef falls over:
> dummy.coef.lm(lm(y ~ z * poly(x,1), data=df))
Error in poly(x, 1): Object "x" not found
> dummy.coef.lm(lm(y ~ z * I(x), data=df))
Error in unique(c("AsIs", class(x))): Object "x" not found
but
2005 Dec 09
1
O-ring statistic
Rainer M Krug writes:
> Thorsten Wiegand used in his paper Wiegand T., and K. A. Moloney 2004.
> Rings, circles and null-models for point pattern analysis in ecology.
> Oikos 104: 209-229 a statistic he called O-Ring statistic which is
> similar to Ripley's K, only that it uses rings instead of circles.
>
> http://www.oesa.ufz.de/towi/towi_programita.html#ring
2002 Jul 10
1
PS to incorrect URL (PR#1766)
Hi -
the list of mirror sites given at www.r-project.org/
also mentions
http://mirror.au.r-project.org/pub/CRAN
The correct URL seems to be
http://cran.planetmirror.com/
regards
Adrian Baddeley
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2001 Nov 21
2
distances from points to line
Dear all,
I have discovered that there are many things that I used to do in my GIS
which are easily done directly in R, for example calculating interpoint
distances using geoR and pick out points inside a polygon using splancs.
I now wonder, is there a function to create a line object like a
watercourse and then calculate the distances between many points in space
and this line?
I couldn't
2007 Mar 26
2
sampling from the uniform distribution over a convex hull
Ranjan Maitra writes:
> Does anyone have a suggestion (or better still) code for sampling
> from the uniform distribution over the convex hull of a set of
> points?
This is implemented in library 'spatstat'.
If x and y are vectors of coordinates of your initial set of points,
library(spatstat)
W <- convexhull.xy(x, y)
P <- runifpoint(42, W)
will compute
2006 Feb 09
1
List Conversion
Hello,
I have a list (mode and class are list) in R that is many elements long and of the form:
>length(list)
[1] 5778
>list[1:4]
$ID1
[1] "num1"
$ID2
[1] "num2" "num3"
$ID3
[1] "num4"
$ID4
[1] NA
I'd like to convert the $ID2 value to be in one element rather than in two.?? It shows up as c(\"num2\", \"num3\") if I try to use
2006 May 19
5
Converting character strings to numeric
I assume that I have missed something fundamental and that it is there in front of me in "An Introduction to R", but I need someone to point me in the right direction.
> x1 <- "1159 1129 1124 -5 -0.44 -1.52"
> x2 <- c("1159","1129","1124","-5","-0.44","-1.52")
> x3 <- unlist(strsplit(x1,"
2010 Sep 16
2
problem reading Matlab file into R
Hi,
I'm trying to read a .mat file into R (2.11.1) with medium success so far. The file I have is a MATLAB 5.0 MAT-file exported from RiverSurveyor LIVE software (http://www.sontek.com/software.php). I have R.matlab and Rcompression installed and readMat() starts reading the file, as can be seen in verbose mode (hence medium success), but then gives the following error:
Error in dim(matrix)
2012 Mar 28
3
Spatstat users.
This is a cry for help. My apologies for taking up bandwidth
with an issue that is not really on topic. But I really do want
to acquire the requested information.
In the course of preparing my PBRF (performance based research
funds) portfolio for the upcoming PBRF exercise here in New Zealand,
I have been advised that I should provide some estimate of the number
of "active users" of