similar to: S3 class question

Displaying 20 results from an estimated 7000 matches similar to: "S3 class question"

2005 Sep 28
1
gfortran Makefile for cygwin
Hi all, I'm porting a package that I've worked on for OS X to Cygwin/Windows. This package requires a Makefile. My question is, how can I find out (or what is), the link command? Here is the OS X Makefile: RLIB_LOC=${R_HOME} F90_FILES=\ class_data_frame.f90 \ class_old_dbest.f90 \ class_cm_data.f90 \ class_cm.f90 \ class_bgw.f90 \ class_cm_mle.f90 \ cme.f90 FORTRAN_FILES=\ dgletc.f
2005 Oct 08
1
windows/g95 peculiarity
I'm not looking for an answer here, this is just a report of a peculiar event I've observed and can reproduce. I'm developing a g95 (20050129) compiled package on windows xp pro using R-2.1.1, and gcc-3.4.2 (mingw special). An older version of the F95 package compiled and ran without problems. The new version of the package includes extensive changes in the code. The package has a
2005 Sep 28
3
gfortran Makefile for windows
Hi all, (Originally posted to r-help) I'm porting a package that I've worked on for OS X to Windows. The package is written in F95 so I need to compile it with gfortran and link it with gcc4. I've been trying to build an R with gcc4 without luck so far. If there is a binary of such a thing info would be appreciated. This package requires a Makefile. My question is, how can I find
2004 Nov 17
3
3d scatter plot with drop line
This is a follow up to my question from yesterday. I want to do in R what is called a "3d scatter plot with drop lines" in S-PLUS. Basically, it's a 3dscatterplot with lines connecting the x-y grid to the z points. The lines give a better perspective on the shape of the data surface. How to? Joel Bremson UC Davis Statistics
2005 Jul 27
1
spss.read factor reversal
Hi, I'm having a problem with spss.read reversing my factor input. Here is the input copied from the spss data editor: color cost 1 2.30 2 2.40 3 3.00 1 2.10 1 1.00 1 2.00 2 4.00 2 3.20 2 2.33 3 2.44 3 2.55 For color, red=1, blue=2, and green = 3. It's type is 'String' and >out=read.spss(file) >out $COLOR [1] green blue red green green green blue blue blue red red
2004 Oct 29
2
why should you set the mode in a vector?
Hi all, If I write v = vector(mode="numeric",length=10) I'm still allowed to assign non-numerics to v. Furthermore, R figures out what kind of vector I've got anyway when I use the mode() function. So what is it that assigning a mode does? Joel
2005 May 18
2
Fortran 95 in R ?
Is it possible to run Fortran 95 code from R? I don't think so, but hopefully someone can prove me wrong. Here is the test I tried: A little fortran 95 subroutine: subroutine allloc() real, dimension(:, :), allocatable :: a integer :: n n = 10 allocate(a(n,n+1)) end I then compiled: >g95 -c allloc.f >R CMD SHLIB allloc.o Here is what happens when I try to dyn.load it in R 2.1.0
2005 May 18
2
Fortran 95 in R ?
Is it possible to run Fortran 95 code from R? I don't think so, but hopefully someone can prove me wrong. Here is the test I tried: A little fortran 95 subroutine: subroutine allloc() real, dimension(:, :), allocatable :: a integer :: n n = 10 allocate(a(n,n+1)) end I then compiled: >g95 -c allloc.f >R CMD SHLIB allloc.o Here is what happens when I try to dyn.load it in R 2.1.0
2004 Nov 17
1
persp grid
I've got a 4x4 matrix of points from a 2-way ANOVA I'd like to plot. The x,y correspond to the treatment groups and look like this ((1,1),(1,2),(1,3),(1,4),(2,1),...). The z is the 4x4 matrix. How can I get persp to grid the x,y axis with only the numbers 1-4 on both? Regards, Joel Bremson UC Davis Statistics Dept.
2005 May 20
1
using src/Makevars file
Hi all, Thanks to all who offered advice on using F95 in R. Now I'm trying to compile a test package using gfortran, Linux 2.4.21 and R 2.1.0. I was able to successfully compile and use a test F95 routine by setting my environment variables as follows in bash: export PATH=~/bin/:$PATH export F77=gfortran export LD_LIBRARY_PATH=~/bin/irun/lib export GFORTRAN_STDIN_UNIT=-1 Now I'm
2005 Jun 06
1
segmentation fault - debugging
Hi all, I'm trying to debug some fortran 95 code that I'm bringing in with a dyn.load(). I'm compiling a number of files using g95 on intel linux w/ R 2.1.0. The .so file loads without complaint, but when I try to call it I get a seg fault. I was hoping I could get a core dump in order to get some more clues about what is going on, but no luck. I'm relatively new to fortran
2003 Jun 08
2
LDA: normalization of eigenvectors (see SPSS)
Hi dear R-users I try to reproduce the steps included in a LDA. Concerning the eigenvectors there is a difference to SPSS. In my textbook (Bortz) it says, that the matrix with the eigenvectors V usually are not normalized to the length of 1, but in the way that the following holds (SPSS does the same thing): t(Vstar)%*%Derror%*%Vstar = I where Vstar are the normalized eigenvectors. Derror
2009 Oct 20
1
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
I'd like to suggest that whenever there is no S3 method implementation available for a particular class, that the error message would also report the class structure of the object dispatched on. Example: foo <- function(...) UseMethod("foo") foo.ClassA <- function(object, ...) { cat("foo() for ClassA called.\n") } > foo(structure(1, class="ClassA"))
2016 Apr 18
3
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Scenario: An S3 method is declared for an S4 base class but called for an instance of a derived class. Steps to reproduce: > Rscript -e "test <- function(x) UseMethod('test', x); test.Matrix <- function(x) 'Hi'; MatrixDispatchTest::test(Matrix::Matrix())" Error in UseMethod("test", x) : no applicable method for 'test' applied to an
2006 Mar 15
1
Additional arguments in S3 method produces a warning
Hello, I just notice this: > x <- c(1:4,0:5, 4, 11) > library(pastecs) Loading required package: boot > tp <- turnpoints(x) > extract(tp, no.tp = FALSE, peak = TRUE, pit = FALSE) [1] FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE Warning message: arguments after the first two are ignored in: UseMethod("extract", e, n, ...) >
2016 Apr 19
3
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Thanks for looking into it, your approach sounds good to me. See also R_has_methods_attached() (https://github.com/wch/r-source/blob/42ecf5f492a005f5398cbb4c9becd4aa5af9d05c/src/main/objects.c#L258-L265). I'm fine with Rscript not loading "methods", as long as everything works properly with "methods" loaded but not attached. -Kirill On 19.04.2016 04:10, Michael
2024 Apr 20
2
passing a modified argument to an S3 method
I do not understand what your goal is here (more context may be helpful, perhaps to others rather than me). So I doubt this is what you want, but here is a guess -- no need to respond if it is unhelpful: ## test.default returns NULL if object "y" not found in **calling environment and enclosures**; ## otherwise y. test <- function(x){ UseMethod("test") } test.default
2015 Jul 23
2
Método S3 paquete
Hola, Estoy tratando de crear un método S3 llamado "anthr" dentro del paquete que estoy desarrollando, cuyo argumento principal es "res" que básicamente es una lista con un solo componente. Pero si el segundo argumento llamado "oneSize" es FALSE, "res" es una lista de listas. Lo que he escrito hasta el momento es lo siguiente: anthr <- function(res,
2019 Oct 09
2
S3 lookup rules changed in R 3.6.1
tl;dr: S3 lookup no longer works in custom non-namespace environments as of R 3.6.1. Is this a bug? I am implementing S3 dispatch for generic methods in environments that are not packages. I am trying to emulate the R package namespace mechanism by having a ?namespace? environment that defines generics and methods, but only exposes the generics themselves, not the methods. To make S3 lookup work
2016 Apr 19
2
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
See also .isMethodsDispatchOn, which is what trace uses to decide if the methods package needs to be loaded. ~G On Tue, Apr 19, 2016 at 5:34 AM, Michael Lawrence <lawrence.michael at gene.com > wrote: > Not sure why R_has_methods_attached() exists. Maybe Martin could shed > some light on that. > > On Mon, Apr 18, 2016 at 11:50 PM, Kirill M?ller > <kirill.mueller at