similar to: accesing slots of S4 class in C code

Displaying 20 results from an estimated 1000 matches similar to: "accesing slots of S4 class in C code"

2003 Sep 29
1
Rcmdr and Macintosh
Hi everyone! I am planning to use R and Rcmdr in a basic stat course. I have no access to a computer lab, but I can expect all students to have a laptop. Of couse, I have no control over their OS and in my experience several of them will have Macs. I have Windows. My question is the following: can I expect them to be able to install R, Tcl/Tk and Rcmdr (i.e. does anybody has experinece with it?)
2007 Jun 04
2
missing IntegerFromString()
I have created a DLL not so long ago using C code. My code used the IntegerFromString() function that used to be exported in the Rinternals.h header file (and thus easily accessible). Recently I upgraded to R 2.5.0 and my DLL stopped working. I see that the IntegerFromString() function is not exported in any of the header files in the RHOME\include directory. Is it possible for me to use it
2003 Oct 01
1
Macintosh binaries; was: Rcmdr and Macintosh
I am a Windows user and trying to make life easier for my Mac-using students. After investigating the Mac situation more, it appears that the key to easy use is having precompiled binaries. However the packages I am interested in (Rcmdr and its required package, car) do not have one. I do not have easy access to a Mac, so I have a plea to Macintosh users: could someone please create them if it is
2004 Apr 26
1
Segfault: .Call and classes with logical slots
Hi, the following example aiming at a class containing a logical slot segfaults under R-1.9.0 when `gctorture(on = TRUE)' is used: Code code (dummy.c): #include <Rdefines.h> SEXP foo() { SEXP ans; PROTECT(ans = NEW_OBJECT(MAKE_CLASS("test"))); SET_SLOT(ans, install("lgl"), allocVector(LGLSXP, 1)); LOGICAL(GET_SLOT(ans,
2009 Sep 18
2
Ruuid missing Gtk glib.dylib
Hi, I get an error indicating a missing library from the package 'Ruuid'. I suppose this means I should install RGtk. I just thought I'd document the error. Maybe a dependency entry is missing? R 2.9.0 OS X 10.5.8 Thanks, - chris > biocLite('Ruuid') Using R version 2.9.0, biocinstall version 2.4.12. Installing Bioconductor version 2.4 packages: [1] "Ruuid"
2004 Oct 11
1
install failure Ruuid package on OS X
Dear All, When installing the Ruuid package (from Bioconductor) from sources on my MAC (OS X 10.3.5, R version 2.0.0) I get the following errors: m00245:~ ivisser$ R CMD INSTALL -l /Users/ivisser/Library/R/library/ /Users/ivisser/Desktop/Ruuid * Installing *source* package 'Ruuid' ... loading cache ./config.cache checking for glib-config... no checking how to run the C preprocessor...
2006 Dec 20
4
R windows crash (PR#9426)
Full_Name: Robert Denham Version: R-2.4.1 OS: Windows Xp Submission from: (NULL) (61.88.57.1) R gui exits without warning when I run a function which has an argument with a default that is not found. This was a result of an error in a function I wrote, but I thought that it should exit more gracefully than it does. Here is an example: testfun <- function(aa=aa) { aa <-
2009 Jun 20
2
Special characters in Rd example section will cause errors
Hi (Duncan?), The other day I noticed some characters will cause errors in R CMD CHECK because of parse_Rd(), and AFAIK, these chars include '%', '{' and '}'. For example, note the comments in the example section: %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% \name{testfun} \Rdversion{1.1} \alias{testfun} \title{ A Test } \description{ A test } \usage{ testfun() } \value{ NULL }
2012 Oct 07
3
get: problem with environments
Dear R users, I am running R-2.15.1 in Linux Slackware64-14.0. Here is my minimal working example: testfun <- function (x) { a <- 0; sapply(X="a", FUN=get, envir=sys.frame(which=x)); } Inside R, that is R called from within a Linux terminal, the following code works: testfun(x=5) print(testfun(x=6)) But within rkward the above code fails and the following works: testfun(x=1)
2011 Jul 12
2
foreach not recognizing functions in memory
All, I am not understanding the scoping used in foreach when it is used inside a function. I keep getting "could not find function" errors for functions that are in memory when I try to use foreach within a function call. I have a simple example below. "testFun" is in memory and works when called by foreach directly, but when I place foreach in a function called
2015 Feb 18
2
Different serialization of functions in interactive vs. batch mode
Hi, I posted this question to the regular help list, but it seems to be this is probably a question that is better addressed on r-devel. Sorry for the double posting. I am using hash-values to cache certain results in R. This caching also depends on the hash-value of the function that is being cached (calculated using the digest package). I noticed that computations that should already be cached
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
Dear All, I have three classes of questions about generating random numbers with different packages (windows xp 32bit R). . 1. Suppose I would like to use package *foreach*, can I use current Sys.time as a seed? Although I can get the time up to1e-6 second precesion, the code below dose not work well on a local machine with two cores. ################# library(foreach) library(snow)
2015 Feb 18
4
Different serialization of functions in interactive vs. batch mode
Hi Luke, Ah - I see - thank you! This at least points me to a way on how to "fix" this. I tried setting the srcref attribute to NULL, but the hash value is still different and so is the serialization. So this looks like it is one difference, but not all of them Even if all differences were identified - it still leaves me with different behavior between interactive and batch-mode,
2013 Jan 14
2
The three-dot question
Dear all, Why does not the three-dot accept arguments from the parent environment? I am just confused with this error, can someone give me a hint? > rm(list=ls()) > testFun <- function(a, ...) + { + if(a){ + print(a) + }else + { + print(b) + } + } > > myTask <- function(a) + { + b <- 3 + testFun(a, b = b) + } >
2006 Jun 12
1
Ruuid had non-zero exit status (PR#8965)
> source("http://www.bioconductor.org/biocLite.R") > biocLite(c("Ruuid")) Running getBioC version 0.1.6 with R version 2.3.1 Running biocinstall version 1.8.4 with R version 2.3.1 Your version of R requires version 1.8 of Bioconductor. trying URL 'http://bioconductor.org/packages/1.8/bioc/src/contrib/Ruuid_1.10.0.tar.gz' Content type 'application/x-gzip'
2010 Jul 18
2
NA preserved in logical call - I don't understand this behavior because NA is not equal to 0
I am confused by the behavior of the below piece of code. The NAs are making it past the logical call ==0. I am sure that I am missing something. I just don't understand this behavior. Thanks for your help in advance. ########code####################################################### left <- (structure(list(measurment_num = c(2, 2.2, 2.4, 2.6, 2.8, 2.82, 3, NA, NA, NA),
2012 Jun 10
3
Data.frames can not hold objects...What can be done in the following scenario?
R-Help community, I understand that data.frames can hold elements of type double, string etc but NOT objects (such as a matrix etc). This is not convenient for me in the following situation. I have a function that takes 2 inputs and returns a vector: testfun <- function (x,y) seq(x,y,1) I have a data.frame defined as follows: testframe<-data.frame(xvalues=c(2,3),yvalues=c(4,5)) I would
2009 Sep 16
3
apply function across two variables by mult factors
Greetings, I am attempting to run a function, which produces a vector and requires two input variables, across two nested factor levels. I can do this using by(X, list(factor1, factor2), function), however I haven't found a simple way to extract the list output into an organized vector form. I can do this using nested loops but it isn't exactly an optimal approach. Thank you
2009 Sep 29
3
How do I access class slots from C?
Hi I'm trying to implement something similar to the following R snippet using C. I seem to have hit the wall on accessing class slots using C. library(fPortfolio) lppData <- 100 * LPP2005.RET[, 1:6] ewSpec <- portfolioSpec() nAssets <- ncol(lppData) setWeights(ewSpec) <- rep(1/nAssets, times = nAssets) ewPortfolio <- feasiblePortfolio( data = lppData, spec = ewSpec,
2012 Jun 09
1
Applying a function to a column of a data frame
Apologees the novice question. Currently climbing up the learning curve of R. Suppose I have the following function and the data.frame: testfun<-function(x=1,y=2) x+y testframe=data.frame(col1=c(1,2),col2=c(3,4)) When evaluating testfun, I want to use the default value for y (which is 2) and for x, I want to feed (one by one) the values in col2 of testframe. How can I achieve this please?