Displaying 20 results from an estimated 9000 matches similar to: "Summary: do.call and environments"
2004 Mar 10
5
do.call and environments
Hello,
I want to call a function "fx" given by name, where some "global"
variables (in the environment of fx) are passed to the function. For
compatibility reasons I cannot modify the parameter list of fx and I
want to avoid setting variables in the global environment (e.g. via <<-)
Is there a way, how to do this?
Thomas P.
The example:
fx <- function(y)
2017 Mar 19
2
outer not applying a constant function
Hi,
the function outer can not apply a constant function as in the last line of the following example:
> xg <- 1:4
> yg <- 1:4
> fxyg <- outer(xg, yg, function(x,y) x*y)
> fconstg <- outer(xg, yg, function(x,y) 1.0)
Error in outer(xg, yg, function(x, y) 1) :
dims [product 16] do not match the length of object [1]
Of course there are simpler ways to construct a constant
2017 Mar 20
1
outer not applying a constant function
> Or is this a bad idea?
I don't like the proposal. I have seen code like the following (in
fact, I have written such code, where I had forgotten a function was
not vectorized) where the error would have been discovered much later
if outer() didn't catch it.
> outer(1:3, 11:13, sum)
Error in outer(1:3, 11:13, sum) :
dims [product 9] do not match the length of object [1]
2000 Dec 18
2
Segmentation fault with expression on linux
I have a problem, that the plot of mathematical formula sometimes
crashes R on Linux (SuSE 6.2 and 7.0 on a Dual PIII/500 machine with 1GB
RAM). The problem occurs for example in demo("graphics"), i.e. in the
last part were the mathematical symbols are plotted.
There are several circumstances to reproduce this segmentation fault,
but the following is one of the most simple examples. The
2010 Nov 03
3
R package BibTex entries: looking for a more general solution
== Summary ==
* Problem: BibTeX entries extracted from R packages via citation()
require too much manual editing to be
of general use.
* Proposal: Date: fields should be made mandatory in package DESCRIPTION
files, perhaps
beginning with warnings from R CMD check
* Proposal: Package authors should be encouraged to use a (new)
Contributors: field in the DESCRIPTION file
rather than packing all
2001 Mar 15
1
supressing linefeed at end of file
Hello,
I want to do simulations with an external simulation model. For this
purpose I wrote a R-script which makes the pre- and post-processing of
the data (generate scenarios, analyze results).
The R-script writes the input file for the simulation with e.g.
write(x, file="test.dat", ncolumns=10)
The problem is, however, that this command (and even constructions with
cat) will add a
2005 Jul 27
4
odesolve/lsoda differences on Windows and Mac
Hi -
I am getting different results when I run the numerical integrator
function lsoda (odesolve package) on a Mac and a PC. I am trying to
simulating a system of 10 ODE's with two exogenous pulsed inputs to the
system, and have had reasonably good success with many model parameter
sets. Under some parameter sets, however, the simulations fail on the
Mac (see error message below). The
2008 Mar 25
3
derivatives in R
Hi, I posted this message earlier in "Rmetrics" and I don't know whether I
posted in the wrong place, so I'm posting it again in Rhelp.
I have a function in x and y and let's call it f(x,y). I need to get the
Hessian matrix. i.e I need (d^2f/dx^2), (d^2f/dxdy), (d^2f/dydx),
(d^2f/dy^2).I can get these using the D function. now I need to evaluste the
hessian matrix for
2002 Jan 19
1
Synthesis of harmonic functions
Hello,
I try to synthesize harmonic functions with a subset of frequencies
determined by fast fourier transform. I wrote two different functions, a
looped version and a matrix multiplication version. As an example the
looped version takes 5 sec and the matrix-version takes 3-4 sec (R 1.4,
Athlon 1.2 GHz, 256 MB, Win ME), but the latter needs huge amount of
memory due to the matrices. So, none of
2005 Apr 04
5
a question about box counting
Hi,
I have a set of x,y data points and each data point lies between (0,0)
and (1,1). Of this set I have selected all those that lie in the lower
triangle (of the plot of these points).
What I would like to do is to divide the region (0,0) to (1,1) into
cells of say, side = 0.01 and then count the number of cells that
contain a point.
My first approach is to generate the coordinates of these
2003 Sep 08
2
R video
Hi
Does anybody know of any R packages under Windows to produce video files
from a sequence of R graphs -- e.g. in .wmv or avi format?
Thanks
David
2001 Mar 16
2
Clip contour or image
Hi,
I am almost new to R. Would any one show me (please include an example)
how to clip a contour or image figure so that I only see the image or
lines inside a selected area?
Thank you very much
Han
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info",
2001 Feb 05
1
get vector data from contour
I have carried out a spatial interpolation (Kriging) using surf.gls()
The contour plot looks very plausible and the image plot is o.k too.
The problem is, hovever, that I need the vectorized isoplethes, as in
contour().
Unfortunately, I found no solution to get the internal data from
contour().
Is there a possibility to extract contour lines as x-y-polygon from a
grid without hacking plot3d.c?
2013 Apr 18
3
Linux distribution with gcc 4.8 and AddressSanitizer ?
Dear R developers,
I've got an information from Prof. Ripley regarding a bug found with
AdressSanitizer in one of our packages. It is now fixed, thank you for
this information.
Now, I would like to run AddressSanitizer myself before submitting the
patched package to CRAN.
Is there a recommendation of a suitable Linux distribution with gcc 4.8,
ideally an ISO image or (even better) a
2003 Sep 12
2
Getting greek letters in plot labels and title
Hi,
Does any one knows how to include greek letters in plot labels and plot
titles ?
Thanks a lot
paul
---
[[alternative HTML version deleted]]
2009 Mar 04
1
CRAN package check on MacOS: sh: line 1: gs: command not found
Dear R developers,
I recently observed a NOTE on several MaxOS X package checks:
sh: line 1: gs: command not found
!!! Error: Closing Ghostscript (exit status: 127)!
/usr/bin/texi2dvi: thumbpdf exited with bad status, quitting.
See for details:
http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/simecol-00check.html
or
2004 Feb 19
1
efficient matrix approx
Hello,
I am looking for a highly efficient matrix version of linear
interpolation (like approx). As an example I have data like follows:
x<-data.frame(time=1:20, x=(1:20)/10, y=runif(20))
t <- seq(1.5, 15.5 ,by=0.5)
# and I found the following solution:
nam <- names(x)
app <- lapply(x[2:3],approx,x=x$time, xout=t)
r <- c(1, 2*(1:(ncol(x)-1)))
x.new <-
2017 Mar 20
0
outer not applying a constant function
>>>>> Gebhardt, Albrecht <Albrecht.Gebhardt at aau.at>
>>>>> on Sun, 19 Mar 2017 09:14:56 +0000 writes:
> Hi,
> the function outer can not apply a constant function as in the last line of the following example:
>> xg <- 1:4
>> yg <- 1:4
>> fxyg <- outer(xg, yg, function(x,y) x*y)
>> fconstg
2008 Mar 16
1
optim: why is REPORT not used in SANN?
Hello,
I wonder why the control parameter REPORT is not supported by method
SANN. Looking into optim.c I found an internal constant:
#define STEPS 100
... and decreasing this to 10 helped me fine-tuning the annealing
parameters in an actual problem.
Is there any reason why not passing nREPORT to samin and setting
something like:
STEPS = nREPORT / tmax
Thomas P.
--
Thomas Petzoldt
2009 Oct 17
2
linking to package directories broken in R >= 2.10 beta
Dear R developers,
some of our packages come with additional programming examples in a
directory called "/examples" which is created from "/inst/examples".
This directory is linked from the docs (e.g. in inst/doc/index.html):
<dl>
<dt><a href="../examples/">examples</a>:
<dd>Source code of examples
</dl>
Given, that we have a