similar to: Vectorizing loop

Displaying 20 results from an estimated 1200 matches similar to: "Vectorizing loop"

2005 Oct 10
5
Show Progress in loop
Hi I have a loop which is doing time consuming calculations and I would like to be able to have some feedback on where it is in it's calculations. I tried to simply show the counter variable in the loop, but id doesn't work as all display seems to be delayed until the loop is completed. Is there any way of displaying the progress of a loop? Rainer The loop: for (i in
2006 Sep 20
4
Calculating mean together with split
Hi I have a table called npl containing results of simulations. It contains about 19000 entries and the structure looks like this: NoPlants sim run year DensPlants 1 6 lng_cs99_renosterbos 1 4 0.00192 . . . it has 43 different entries for sim and year goes from 1 to 100, and run from 1 to 5. I would like to calculate the mean of DensPlants for each
2005 Sep 30
2
Creating an array [0 to 101] of a list
Hi I looked, but I didn't find it: I need an array [0 to 101] where each element is a list (the result of Kest in spatstat). I.e. I want to do: A[2] <- Kest(pp1) A[3] <- Kest(pp2) ... A[101] <- Kest(pp100) How can I create A ? Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology University of Stellenbosch Matieland
2012 Jul 02
1
SPATSTAT: Minimum points for a Ripley K to be sensible?
Hello, What are the minimum number of points in a point pattern before a clustering analysis using a Ripley K function loses any meaning? I haven't been able to find much comment in the literature about this --- instead case examples typically use 100-200 points as a minimum. Regards, Sebastian Pucilowski
2006 Sep 06
4
problem with putting objects in list
Hi I use the following code and it stores the results of density() in the list dr: dens <- function(run) { density( positions$X[positions$run==run], bw=3, cut=-2 ) } dr <- lapply(1:5, dens) but the results are stored in dr[[i]] and not dr[i], i.e. plot(dr[[1]]) works, but plot([1]) doesn't. Is there any way that I can store them in dr[i]? Thanks a lot, Rainer -- Rainer M. Krug,
2006 Feb 27
2
about"Riply's K function"and "envelope"
hi! I did Riply's K function and envelope in the package "SPATSTAT". When the species number is less, it can work well and it is quickly. But when the species number is more(example:2000), it told me"memory limit". So I change "memory limit". But the speed is very slow. I took 13 hours to run the programe. Perhaps there are other methods that can do it. Or just
2005 Oct 26
1
install.packages under SuSE 10 behind proxy, R 2.2.0 from source
Hi I installed R 2.2.0 from source and want to use install.packages but it doesn't work. http_proxy is set to http://proxy.sun.ac.za:3128 but it still can't connect to the repository. The mirror is available, I can connect to it via the internet. Any help welcome, Rainer -- NEW TELEPHONE NUMBER Tel: +27 - (0)72 808 2975 (w) Rainer M. Krug, Dipl. Phys. (Germany), MSc
2006 Sep 22
1
Update to Dillo browser question
Hi I asked about if there is any way of opening URLs from the help browser in the same window of the same dillo browser - here is the answer. Just to reiterate: dillo is for me the perfect browser for the help of R when you use ?... Rainer -------- Original Message -------- Subject: Re: [Dillo-dev] Opening new URL in same instance and -s option Date: Thu, 21 Sep 2006 21:31:57 -0400 From:
2006 Sep 20
5
Beginners manual for emacs and ess
Hi I heard so much about Emacs and ESS that I decided to try it out - but I am stuck at the beginning. Is there anywhere a beginners manual for Emacs & ESS to be used with R? even M-x S tells me it can't start S-Plus - obviously - but I want it to start R... Any help welcome (otherwise I will be stuck with Eclipse and R) Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc
2006 Dec 01
2
specify point shape for ggplot (equivalent to pch)?
Hi is it possible to specify the shape of the point to be used in ggplot (as with pch in plot)? I couldn't find anything in the help. Thanks Rainer -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Department of Conservation Ecology and Entomology University of Stellenbosch Matieland 7602 South Africa Tel: +27 - (0)72 808 2975 (w) Fax: +27 - (0)86 516 2782 Fax:
2006 Oct 25
3
simplification of code using stamp?
Hi I have the following code which I would like to simplify. Id does linear regressions and returns the r-squares, and the coefficients. It runs slow, as it is doing the regressions for each - is it possible to get the values in a dataframe which looks as follow: expert | xx | seeds | r.squared | slope | intercept Thanks in advance, Rainer library(reshape) rsqs <- as.data.frame(
2006 Mar 10
4
How to get the intercept from lm?
Hi I am using R 2.2.0 under SuSE 10 I want to use lm() to get the slope and intercept for several daatasets and store them in a database. So far so good - but how do I extract the slope and the intercept from the result from lm()? my code looks like this: lmNNDens <- lm(log(DensNN$MeanNN) ~ log(DensNN$MeanDensity)) anovaLM <- anova(lmNNDens) Results$slope[No] <- ???lmNNDens???
2005 Sep 01
2
SpatStat Kest - Error Message help
Hi I'm working with the function Kest in the package SpatStat (under LINUX with R 2.1.0). In order to evaluate the statistical significance of my point pattern I'm doing 999 Montecarlo replications. The script that use the Kest function runs OK for most of the different point patterns that I have but for a particular point pattern, which have only 17 points, it runs until the 34th
2006 Mar 23
4
Create graphs from text console
Hi I am using R 2.2.1 under Linux (SuSE 10) and would like to know if it is possible to create graphs, i.e. jpeg(filename=fn) try( coplot( mor$I_Morisita ~ mor$Year | mor$RunStr, show.given=FALSE) ) dev.off() from a text console? It gives me an error message on the jpeg() command: Error in X11(..snip..) unable to start device jpeg In addition: warning message: unable to open connection to
2005 Dec 20
1
Problems installing R 2.1.1. from rpm (R-base-2.2.0-1.i586.rpm) on SuSE 10
Hi I have problems installing R 2.1.1. from rpm (R-base-2.2.0-1.i586.rpm) on SuSE 10. It installs fine, all dependances are OK (at least Yast does not complain) but when I try to run R, it gives the following error message: symbol lookup error: /usr/lib/libblas.so.3: undefined symbol: _gfortran_filename and R quits. blas version: 3.0-926 Any help appreciated, Rainer -- -- Rainer M.
2006 Nov 01
1
Compare linear regressios for significant differences of the slopes
Hi I have (8 measures * 96 groups) = 768 datasets for which I did linear regressions using lm(). Now I want to compare the slopes for each of the 8 measures in each of the 96 groups. As I understand , I can not use > anova(lm1, ..., lm8) as the lm1 ... lm8 are based on different datasets. I also read in previous discussions in this list, that I can see if the slope +- stddev(slope)
2006 Aug 30
2
density() with from, to or cut and comparrison of density()
Hi the function density() does normally integrate to one - I've checked it and it works and I also read the previous threads. But I realised that it does not integrate to one if I use from, to or cut. My scenario: I simulated densities of a plants originating from an sseed source at distance zero. Therefore the density of the plants will be highest close to zero. Is there anything I can do
2006 Sep 21
1
transforming factor back to numbers
Hi I generate a new dataframe by doing: npl.agg <- aggregate(npl$DensPlants, list(year=npl$year, sim=npl$sim), mean, na.rm=TRUE ) Now I want to plot it by using coplot(npl.agg$x ~ npl.agg$year | npl.agg$sim, type="l") but, as npl.agg$year is seen as a factor, the order of the points on the x-axis (time axis) does not follow the numerical sorting 1...100, but rather the text
2007 Oct 03
2
Speeding up simulation of mean nearest neighbor distances
I've written the function below to simulate the mean 1st through nth nearest neighbor distances for a random spatial pattern using the functions nndist() and runifpoint() from spatsat. It works, but runs relatively slowly - would appreciate suggestions on how to speed up this function. Thanks. --Dale library(spatstat) sim.nth.mdist <- function(nth,nsim) { D <- matrix(ncol=nth,
2013 Feb 07
2
Spatstat - Kest, envelope problem
Hello, I am writing cause I have a problem when try to create confidence envelopes in spatstat. I have a point data representing firms in my study area. When I try to create confidence envelopes the error message turns up: [> p <- envelope(point, fun=Kest, nsim=99) Error in marks.ppp(Y, dfok = FALSE) : Sorry, not implemented when the marks are a data frame] Could you write me how can I