similar to: making a grid of points

Displaying 20 results from an estimated 5000 matches similar to: "making a grid of points"

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
2005 Dec 09
3
external pointers
I have some C data I want to pass back to R opaquely, and then back to C. I understand external pointers are the way to do so. I'm trying to find how they interact with garbage collection and object lifetime, and what I need to do so that the memory lives until the calling R process ends. Could anyone give me some pointers? I haven't found much documentation. An earlier message
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 >
2006 Feb 13
1
Turning control back over to the terminal
I'm invoking R from withing a shell script like this R --no-save --no-restore --gui=none > `hostname` 2>&1 <<BYE # various commands here BYE I would like to regain control from the invoking terminal at some point. I tried source(stdin()) but got a syntax error, presumably stdin is the little shell here snippet (the part between <<BYE and BYE). Is there some way to
2017 Jul 09
2
Histogram plots in Lattice with spatialgrid dataframe data
Hi all, I can not seem to get what I want using the Lattice package to generate an array of histograms of spatialgrid dataframe data. I can use the sp package and spplot to generate an array of maps that display an array of spatialgrid dataframe data -- that's good. I have:
2011 Sep 14
1
S4 method dispatch
List, In order to get rid of some old, unreadable S3 code in package sp, I'm trying to rewrite things using S4 methods. Somewhere I fail, and I cannot sort out why. In order to isolate the problem, I created two functions, doNothing<- and dosth, and both should do nothing. The issue is that in most cases they do nothing, but in some cases dosth(obj) changes the class of obj and breaks with
2017 Jul 09
0
Histogram plots in Lattice with spatialgrid dataframe data
Hello all, After more digging I was able to find out how to do this. The answer came from an example here: https://stackoverflow.com/questions/3541713/how-to-plot-two-histograms-together-in-r yr_1997<-data.frame(bias=ann_bias$bias1997) yr_1998<-data.frame(bias=ann_bias$bias1998) yr_1999<-data.frame(bias=ann_bias$bias1999) yr_2000<-data.frame(bias=ann_bias$bias2000)
2011 Jan 05
1
Prediction error for Ordinary Kriging
Hi ALL, Can you please help me on how to determine the prediction error for ordinary kriging?Below are all the commands i used to generate the OK plot: rsa2 <- readShapeSpatial("residentialsa", CRS("+proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs")) x2 <- readShapeSpatial("ptna2",
2006 Jan 02
2
checkpointing
I would like to checkpoint some of my calculations in R, specifically those using optim. As far as I can tell, R doesn't have this facility, and there seems to have been little discussion of it. checkpointing is saving enough of the current state so that work can resume where things were left off if, to take my own example, the system crashes after 8 days of calculation. My thought is that
2017 Jul 10
1
Histogram plots in Lattice with spatialgrid dataframe data
Glad you found an answer, though it looks more self-educational than efficient (see suggestions below). In the future, follow the recommendations of the Posting Guide: use plain text, and provide a reproducible example. Some elaborations on what "reproducible" means are [1][2][3]. One issue here was that you did not include sample data to work with (I have assumed below that ann_bias has
2006 Jan 31
2
an unpleasant interaction of environments and generic functions
I've run into an unpleasant oddity involving the interaction of environments and generic functions. I want to check my diagnosis, and see if there is a good way to avoid the problem. Problem: A library defines "foo" <- function(object) 1 setMethod("foo", c("matrix"), function(object) 30) After loading the library foo(0) is 1 foo(matrix()) is 30 foo is a
2006 Oct 02
1
documenation duplication and proposed automatic tools
I've been looking at documenting S4 classes and methods, though I have a feeling many of these issues apply to S3 as well. My impression is that the documentation system requires or recommends creating basically the same information in several places. I'd like to explain that, see if I'm correct, and suggest that a more automated framework might make life easier. PROBLEM Consider a
2008 Jul 28
1
grid.ls() after grid.remove() fails
Dr Murrell and others, It seems grid.ls() fails after any use of grid.remove(). It gives an infinite recursion error even in the simplest cases, and no matter what arguments are passed to grid.ls. > library(grid) > grid.newpage() > grid.lines(name="foo") > grid.ls() foo > grid.remove("foo") > grid.ls() Error: evaluation nested too deeply: infinite recursion
2003 May 12
3
grid - deleting and erasing grobs?
Hello! Don't quite understand how can I delete grobs and simultaneously erase graphic output they produce. I first change grob's "vp" field to null (grid.edit(gr,vp=NULL)) to erase it and then call rm(gr) (as grobs are external pointers I'm not shure what this method actually frees allocated memory). May be there is simpler method? Does garbage collector have any effect
2003 May 12
3
grid - deleting and erasing grobs?
Hello! Don't quite understand how can I delete grobs and simultaneously erase graphic output they produce. I first change grob's "vp" field to null (grid.edit(gr,vp=NULL)) to erase it and then call rm(gr) (as grobs are external pointers I'm not shure what this method actually frees allocated memory). May be there is simpler method? Does garbage collector have any effect
2005 Nov 23
2
Makefiles and other customization
Writing R Extensions mentions that a package developer can provide a Makefile, but gives very little information about what should be in it. It says there must be a clean target, and later on there's mention of $(SHLIB): $(OBJECTS) $(SHLIB_LINK) -o $@ $(OBJECTS) $(ALL_LIBS) (in the F95 discussion). What should a Makefile provide, and what can it assume? In other words,
2007 Sep 12
1
"could not find function" in R CMD check
During R CMD check I get this: ** building package indices ... Error in eval(expr, envir, enclos) : could not find function "readingError" Execution halted ERROR: installing package indices failed The check aborts there. readingError is a function I just added; for reference setClass("readingError", contains="matrix") readingError <- function(...)
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 <-