Displaying 20 results from an estimated 700 matches similar to: "Size of a refClass instance"
2011 Sep 24
1
Can't reliably use RefClass methods in Snowfall
Greetings,
I am trying to use Reference Class methods in Snowfall, using R 2.12.1
on Ubuntu Natty. Using then directly seems to work (stanza 2 below),
but using them indirectly does not (stanza 3 below). I get an "attempt
to apply non-function" error.
In addition to exporting the instance of the object I created to the
Snowfall slaves, I also made several attempts to export the
2005 Feb 24
4
r: functions
hi all
i have a function that uses two inputs, say xdata and ydata. An example
is the following,
simple1<-function(xdata,ydata)
{
ofit<-lm(ydata~xdata)
list(ofit)
}
say i use arbitray number for xdata and ydata such that
D =
x1 x2 y
1 1 10
2 6 6
3 10 7
x<-D[,1:2]
and
y<-D[,3]
if one uses these inputs and rund the program we get the following:
>simple(xdata=x,ydata=y)
2011 Mar 10
1
Testing for a reference class object
Hi all,
I've constructed the following function to test whether or not an
object was created from a reference class:
isRefClassObject <- function(x) isS4(x) &&
is.environment(attr(x,'.xData')) &&
exists('.refClassDef',attr(x,'.xData'))
but I'm unsure if it's a complete test or if there's a better way to
test. Regardless, It would be
2009 Jun 03
3
Return variable assignments from a function
I'd like to perform return variable assignments like matlab. For example,
the following function would return A, B, and c to the script that called
it.
=================================
function [A,B,c] = simple(m,n)
A=[ 3 2; 3 3]
B=m
c=1:n
=================================
I'd like to do similar assignments in R, but I seem to be able to only
return one variable. I tried to use a
2015 Sep 29
1
making object.size() more meaningful on environments?
Hi Gabe,
On 09/29/2015 02:51 PM, Gabriel Becker wrote:
> Herve,
>
> The problem then would be that for A a refClass whose fields take up N
> bytes (in the sense that you mean), if we do
>
> B <- A
>
> A and B would look like the BOTH take up N bytes, for a total of 2N,
> whereas AFAIK R would only be using ~ N + 2*56 bytes, right?
Yes, but that's still a *much*
2011 Apr 24
0
should I use setRefClass() ?
Hello,
I am somewhat new to R programming and a novice C++ programmer.
I'd like to know if I should use setRefClass() to manage objects, functions,
and data in a very large program I am attempting to code.
See:
http://stat.ethz.ch/R-manual/R-devel/library/methods/html/refClass.html
I like the referential class structure that C++ provides and R seems to
provides via setRefClass(). Mainly
2012 Apr 13
0
Reference Class import() behaviour
Dear All,
In a project I've been working on we've been using Reference Classes
and grid extensively. However, something that I have come across is
that when using the import() method on refclass objects, it does not
work as expected with grid grobs and viewports.
I have prepared test cases that illustrate the point but the general
idea is that importing appears to work fine for
2013 Oct 16
1
Internally accessing ref class methods with .self$x is different from .self[['x']]
When a reference class method is accessed with .self$x, it has
different behavior from .self[['x']]. The former copies the function
to the object's environment (with some attributes attached), and the
latter just return NULL (unless it has already been accessed once with
.self$x). Is this how it's supposed to work?
Here's an example that illustrates:
2011 Oct 07
1
Pb building sets of S4 / RefClass objects with package "sets"
Hi,
does anyone know if it is possible to construct sets of S4 objects?
It seems the constructor set does not like it:
Error in as.vector(x, "character") :
cannot coerce type 'environment' to vector of type 'character'
Regards
Johnny
PS: by the way, does anyone know where I can find some examples using the
cset class from the "sets" package, beside the
2011 Oct 07
0
Pb building sets of S4 / RefClass objects with package "sets"
Hi,
does anyone know if it is possible to construct sets of S4 objects?
It seems the constructor set does not like it:
Error in as.vector(x, "character") :
cannot coerce type 'environment' to vector of type 'character'
Regards
Johnny
[[alternative HTML version deleted]]
2010 Oct 23
1
Plans for tighter integration of reference classes in R.
Hello Everyone! Here are a couple of thought/questions on refClasses
integration in R core functionality.
First, coexistence with S4:
> X <- setRefClass("classX", fields = c("a", "b"),
+ representation = list(c = "character"))
> x <- X$new()
> x at c <- "sss"
> x
An object of class "classX"
2011 Jun 06
1
Reference Classes: shortcut like 'isS4' for Ref Classes?
Dear list,
is there a shortcut-function to check whether a class is a Reference
Class or not? There's something like this for S4 classes
('isS4(object)'), but I couldn't find anything regarding Ref Classes.
Currently, I'm doing it this way, which is a bit clumsy:
A <- setRefClass("A", fields=list(X="numeric"))
a <- A$new()
isRefClass <-
2015 Jul 03
1
Are downstream dependencies rebuilt when a package is updated on CRAN?
I was wondering: are the downstream dependencies of a package rebuilt
when a package is updated on CRAN? (I'm referring to the binary
packages, of course.)
The reason I ask is because there are cases where this can cause
problems. Suppose that when pkgB is built, it calls
pkgA::makeClosure(), which returns a closure that refers to a function
in pkgA. Suppose this code is in pkgA 1.0:
2013 Oct 15
0
[LLVMdev] [Debug Info PATCH] for support of ref_addr and removal of DIE duplication
On Wed, Oct 9, 2013 at 5:22 PM, Manman Ren <manman.ren at gmail.com> wrote:
>
>
>
> On Wed, Oct 9, 2013 at 1:32 PM, Manman Ren <manman.ren at gmail.com> wrote:
>
>>
>> David,
>>
>> Thanks for reviewing!
>>
>> On Wed, Oct 9, 2013 at 11:36 AM, David Blaikie <dblaikie at gmail.com>wrote:
>>
>>> Might be easier if
2013 Oct 15
2
[LLVMdev] [Debug Info PATCH] for support of ref_addr and removal of DIE duplication
On Tue, Oct 15, 2013 at 10:05 AM, Manman Ren <manman.ren at gmail.com> wrote:
>
>
>
> On Wed, Oct 9, 2013 at 5:22 PM, Manman Ren <manman.ren at gmail.com> wrote:
>
>>
>>
>>
>> On Wed, Oct 9, 2013 at 1:32 PM, Manman Ren <manman.ren at gmail.com> wrote:
>>
>>>
>>> David,
>>>
>>> Thanks for reviewing!
2002 Oct 05
2
Win2K domain at work, Samba workgroup at home
This is a little off topic, but maybe someone can help. I have a Win2K
laptop that's part of a corporate domain. When I bring it home and add it
to my home LAN, it refuses to access any SMB machine (including a Samba
server, Win98 or Win95 box) complaining that "There are currently no logon
servers available to service the logon request."
Is there any way to fix this easily? I
2012 Dec 11
2
Writing escaped unicode
I'd like to write unicode strings using the "\u" escape syntax. According to the documentation, print.default or encodeString will escape unicode using the \u convention. In practice, I can't make it work.
> b="Unicode character: \ufffd"
> print.default(b)
[1] "Unicode character: ?"
> encodeString(b)
[1] "Unicode character: ?"
I want to
2013 Oct 11
2
[LLVMdev] [Debug Info PATCH] for support of ref_addr and removal of DIE duplication
The first patch seems fine, though the comment on the modified addDIEEntry
function is a bit confusing:
-/// addDIEEntry - Add a DIE attribute data and value.
+/// addDIEEntry - Add a DIE attribute data and value. The form should be
+/// a reference form: ref1, ref2, ref4, ref8, ref_udata, ref_addr,
+/// or ref_sig8. A form can be chosen inside addDIEEntry.
When the comment says "The form
2013 Oct 10
4
[LLVMdev] [Debug Info PATCH] for support of ref_addr and removal of DIE duplication
On Wed, Oct 9, 2013 at 1:32 PM, Manman Ren <manman.ren at gmail.com> wrote:
>
> David,
>
> Thanks for reviewing!
>
> On Wed, Oct 9, 2013 at 11:36 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> Might be easier if these were on Phabricator, but here are some thoughts:
>>
>> 0001:
>> This patch generally, while separated for
2013 Oct 15
0
[LLVMdev] [Debug Info PATCH] for support of ref_addr and removal of DIE duplication
On Tue, Oct 15, 2013 at 10:10 AM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
>
> On Tue, Oct 15, 2013 at 10:05 AM, Manman Ren <manman.ren at gmail.com> wrote:
>
>>
>>
>>
>> On Wed, Oct 9, 2013 at 5:22 PM, Manman Ren <manman.ren at gmail.com> wrote:
>>
>>>
>>>
>>>
>>> On Wed, Oct 9, 2013 at