similar to: locked environment and inheritance

Displaying 20 results from an estimated 200 matches similar to: "locked environment and inheritance"

2011 Jun 01
1
Overloading S4 methods
Dear all, I am experiencing some problems with S4 method overloading. I have defined a generic for graphics:plot, using setGeneric("plot", useAsDefault = plot) and with importFrom('graphics', 'plot') and exportMethods('plot') in the NAMESPACE file of pkg A. I then proceed to define a method for signature c('myS4class', 'missing'). This works
2003 Feb 06
2
function 'silhouette' in package 'cluster'
Dear all, I am trying (without much success) to use the fuction 'silhouette'. Would anyone encountered that before (or would know where I am wrong ?) Please find below the R ouput. Thanks in advance, L. > s <- silhouette(ct, as.dist(metric)) Error in "[<-"(*tmp*, iC, "sil_width", value = s.i) : number of items to replace is not a multiple of replacement
2002 Jan 18
3
Shared libraries for use with R
I am moving my first steps in writing and compiling C code and calling it from R. (I am also new to shared libraries...) My problem is that my C code uses a C function contained in another library (".a", not ".so" - is that the problem?). This is how I compile the file with the functions I want to call from R: cd /export/home/gpetris/ R SHLIB tryit.c cc
1999 Apr 21
1
source("filename") vs. input from command-line
R-helpers, When I source("tmp.r") a file from within R, the code executes without error. When I launch with 'R --no-save --no-restore < tmp.r', the code sometimes appears to cause some type of buffer overflow and nothing gets executed. tmp.r contains: myData<-c(1,0, ... long vector of numbers) followed by a new line character and then some code to operate on myData. It
2006 Sep 26
3
standardization of slot access
Hi, I'm usually confused about when to use 'slot' or '@'. I've frequently read that it's always preferable to use accessor functions, so I would think the '@' operator should be avoided. However, ?slot contains the following advise: "Generally, the only reason to use the functional form rather than the simpler operator is _because_ the slot name has to
2006 Jul 24
1
deparse - width.cutoff
I have a question about "deparse" function in R What is the reason that "deparse" use an argument like "width.cutoff" ? Why the maximum cutoff is 500? I was manipulating an R formula and used "deparse". Since the length of user's formula was greater then 500, my code didnt work. thanks Johan johan Faux <johanfaux@yahoo.com> wrote: I have a
2007 Jan 30
3
silent loading of packages
I would like to turn off all the messages during library(aPackage) or require(aPackage) I tried different commands: invisible, capture.output, sink but none of them is working. For example, loading VGAM, gives a lot of unnecessary messages: > library(VGAM) Attaching package: 'VGAM' The following object(s) are masked from package:splines : bs The
2002 Aug 06
2
[ and setMethod conflict?
I noticed this oddity about [ and setMethod. First, I define testFunc, which sorts a data frame by the first column and returns the entries that aren't NAs, and testIt, which runs testFunc repeatedly on a random large data frame, each time saving the return into a dummy placeholder (for demonstration's sake). > require(methods) Loading required package: methods [1] TRUE > testFunc
2002 Aug 06
2
[ and setMethod conflict?
I noticed this oddity about [ and setMethod. First, I define testFunc, which sorts a data frame by the first column and returns the entries that aren't NAs, and testIt, which runs testFunc repeatedly on a random large data frame, each time saving the return into a dummy placeholder (for demonstration's sake). > require(methods) Loading required package: methods [1] TRUE > testFunc
2005 Dec 29
1
trouble with S4 methods for group "Summary"
Hello. This question concerns the Methods package. I have created a new class and am trying to set a method for it for S4 group generic "Summary". I have run into some signature problems. An example: > setClass("track", representation(x="numeric", y="character")) [1] "track" > setGeneric("max", group="Summary")
2015 Mar 19
6
RFC: Matrix package: Matrix products (%*%, crossprod, tcrossprod) involving "nsparseMatrix" aka sparse pattern matrices
This is a Request For Comment, also BCCed to 390 package maintainers of reverse dependencies of the Matrix package. Most users and package authors working with our 'Matrix' package will be using it for numerical computations, and so will be using "dMatrix" (d : double precision) matrix objects M, and indirectly, e.g., for M >= c will also use "lMatrix" (l:
2002 Jul 19
1
Rprof and setMethod conflict?
I noticed this oddity about R profiling and setMethod. First, I "test out" Rprof. > require(methods) Loading required package: methods [1] TRUE > > Rprof("test.out") > data.frame("a") X.a. 1 a > Rprof(NULL) So far, so good. Next, I define myClass. > setClass("myClass", representation(mySlot = "numeric")) [1]
2006 Jan 13
2
for loop should check the looping index !!
Hello , a<-c(1) for(i in 2:length(a)) do.something with a[[i]] I get : Error in a[[i]] : subscript out of bounds Am I missing something here? Doesnt R check the value of i inside "for" and if the condition is not tru, dont do anything ???? thanks, johan --------------------------------- Got holiday prints? See all the ways to get quality
2004 Sep 20
1
compilation failed for package
Hello, I am new to R on Linux (and to LINUX), running a 1.9.1 on a Linux MDK10.0. When updating or installing different packages, I get messages like this (under), the package doesn't install. Can anyone help me? I know this is all to little information, but I don't know were to start. I think there is something wrong in how or were the C++ or fortran compilator is installed?? Thanks, Geir
2016 Apr 19
2
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
Using the Matrix package, how can I create a row-oriented sparse Matrix from scratch populated with some data? By default a column-oriented one is created and I'm aware of the note that the package is optimized for column-oriented ones, but I'm only interested in using it for holding my sparse row-oriented data and doing basic subsetting by rows (even using drop=FALSE). Here is what I
2007 Mar 20
2
run a script during R CMD build
I would like R CMD build to run some R code which does some stuff and save the result as a file in /inst/docs folder. Is there any way of doing this. Thank you. Johan ____________________________________________________________________________________ We won't tell. Get more on shows you hate to love [[alternative HTML version deleted]]
2004 Jan 29
2
Object validation and formal classes
I'm using R 1.8.1 (Win32, Linux) and have some difficulties using validation functions for S4 classes. The problem is if I specify a validation function with setValidity("myclass", validate.myclass) object validation is only performed when I create an instance using new("myclass"), or when I explicitly call validObject(x) where x is of class "myclass", of
2005 Jun 14
1
operators as S4 methods
Dear all, I need to re-define some mathematical operators (+, *, /, etc) for an S4 class based on array. All references I have found (S Programming, Green Book) show how to define S3 methods for this (like in page 89 of S Programming for "-.polynomial"). What is the preferred S4 way for doing this? I hope I haven't missed some obvious piece of documentation. Many thanks, Iago
2016 Apr 20
0
Matrix: How create a _row-oriented_ sparse Matrix (=dgRMatrix)?
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com> >>>>> on Tue, 19 Apr 2016 14:04:11 -0700 writes: > Using the Matrix package, how can I create a row-oriented sparse > Matrix from scratch populated with some data? By default a > column-oriented one is created and I'm aware of the note that the > package is optimized for
2006 Jul 24
1
conflict of package "Matrix" and summary of lme object
After loading the package "Matrix" (version 0.995-12), using the summary function with an lme (package nlme version 3.1-75) object results in an error message saying Fehler in dim(x) : kein Slot des Namens "Dim" f?r dieses Objekt der Klasse "correlation" (translated: 'Error in dim(x) : no slot of the name "Dim" for this object of class