similar to: Need help in calling C code from R

Displaying 20 results from an estimated 5000 matches similar to: "Need help in calling C code from R"

2008 Aug 01
1
bug in readRAST6 function in package spgrass6
Hi if I try to import a raster layer which consists only of NULL values from grass by using the readRAST6, I get an error message: > readRAST6("HSericea_seedsDisperse_2007") ERROR: Invalid value for null (integers only) Error in readBinGrid(rtmpfl11, colname = vname[i], proj4string = p4, integer = to_int) : no such file:
2008 Nov 19
1
C++ code from R
Hi I managed to compile (and use) C code from R, but now I have to use C++ code. After reading "Writing R extensions", I came up with the following code, which compiles fine ------------------- // emdL1_R.cc: #include <time.h> #include <stdio.h> #include "emdL1.h" extern "C" { void emd_L1( double *H1, int *n1, double *H2, int *n2,
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,
2008 Sep 01
1
linebreak in mathematical anotation?
Hi I am using mathematical anotation to make the labels in a barplot in italics. as an example (adapted from http://finzi.psych.upenn.edu/R/Rhelp02a/archive/129808.html): tt <- c("italic(First~~set)", "italic(Second~~set)", "italic(third~~set") barplot(1:3, names.arg=parse(text=tt)) But I would like to have it with "set" in a second column, like tt
2008 Dec 05
3
How to calculate the distance between two density functions
Dear all, I wrote the following code to calculate the density functions for two data sets, respectively. den_str <-density(str_data$Similarity); den_non_str <-density(nonstr_data$Similarity); However, I would like to knowing the difference between den_str and den_non_str, that is, the difference between the region under the curve of the den_str and the region under the curve of
2009 Mar 06
1
Automatically execute traceback when execution of script causes error?
Hi I am using R scripts which are running remotely. To make debugging easier, I would like to have the possibility to execute traceback() automatically when an error occurs. Is this possible? OS: Linux Thanks Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Faculty of Science Natural
2009 Feb 27
2
Installing different versions of R simultaneously on Linux
Hi I want to install some versions of R simultaneously from source on a computer (running Linux). Some programs have an option to specify a suffix for the executable (eg R would become R-2.7.2 when the suffix is specified as "-2.7.2"). I did not find this option for R - did I overlook it? If it is not, how is it possible to have several versions of R on one computer, or is the only way
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
2008 Sep 27
1
Problem with R on dual core under Linux - can not execute mpi.spawn.Rslaves()
Hi I am trying to utilize my dual core processor (and later a High-performance clusters (HPC) ) by using the Rmpi, snow, snowfall, ... packages, but I am struggling at the beginning, i.e. to initialise the "cluster" on my dual core computer. Whenever I try to initialize it (via sfInit(parallel=TRUE, cpus=2) or mpi.spawn.Rslaves(nslaves=2) ), I get an error message: >
2009 Mar 02
2
Fwd: Converting R to Sweave (Rnw)
Hi I am thinking about using Sweave more frequently, especially for documenting code. But the syntax is slightly awkward for me (<<name>>= ... @), and I was thinking if there would be a way of importing the type of code extracted from an Rnw file back into an Rnw file? The advantage would be that the code could run in R without tangling. Obviously, sweave options could not be
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 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
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 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 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:
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.
2005 Oct 10
3
Vectorizing loop
Hi I have the following loop and would like to vectorize it. Any ideas if it is possible? Thanks, Rainer Tha Loop: for (i in 2:Result$NoSims) { ppp <- runifpoint(Result$NoPlants) K <- Kest(ppp) Result$LSim[i,] <- sqrt(K$iso / pi) - K$r CM <- (Result$LSim[i,] * Result$LSim[i,]) / abs(K$r[2] - K$r[1]) Result$SigCM[i] <- sum(CM, na.rm=TRUE) print(i) flush.console() }
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
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
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(