Displaying 15 results from an estimated 15 matches for "getx".
Did you mean:
get
2006 Sep 12
1
package.skeleton() in R-2.4.1
...package.skeleton() gives an R file that gives an
error when sourced.
If I type
setClass("brob",
representation = representation
(x="numeric",positive="logical"),
prototype = list(x=numeric(),positive=logical())
)
setGeneric("getX",function(x){standardGeneric("getX")})
setMethod("getX","brob",function(x){x at x})
(which is legal, AFAICS), then
package.skeleton(path="~")
I get a file ~/anRpackage/R/getX.R containing:
"getX" <-
structure(function(x){standardGeneri...
2009 Oct 27
1
How to reduce key strokes when defining S4 classes?
...tion(
x='numeric'
)
)
setMethod(
f='initialize',
signature='A',
definition=function(.Object,x){
cat("~~~ A: initializator ~~~\n")
.Object<-callNextMethod(.Object,x=x)
return(.Object)
}
)
setGeneric('getx', function(object){
standardGeneric('getx')
}
)
setMethod('getx', 'A',
function(object){
return(object at x)
}
)
setGeneric('setx<-', function(.object,value){
standardGeneric('setx<-')
}
)
setReplaceM...
2011 Aug 26
1
R.oo data members / inheritance
...n
advance!
Example 1:
setConstructorS3("ClassA", function(A,x) {
if(missing(A))A=15;
if(missing(x))x=NA;
extend(Object(), "ClassA",
.size = A,
.x=x
)
})
setMethodS3("getSize", "ClassA", function(this,...) {
this$.size;
})
setMethodS3("getX", "ClassA", function(this,...) {
this$.x;
})
setConstructorS3("ClassB", function(A,x,bData) {
if(missing(bData))bData = NA;
extend(ClassA(), "ClassB",
.bData = bData
)
})
setMethodS3("getBData", "ClassB", function(this,...) {
thi...
2009 Mar 31
4
what is the preferred method to create a package local variable?
for the moment, I'm using:
.onAttach <- function(libname, pkgname) {
.bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah")
}
.onUnload <- function(libpath) {
dbDisconnect(.bbg.db.conn)
}
which results in a hidden global variable in the global environment.
I would prefer to make the assignment only in the package namespace.
2008 Oct 23
1
Getting the panel location of a xyplot matrix using a mouse click in a GDCanvas
...functionality must be implemented in the GDCanvas because
trellis.focus does work correctly in JGR)
I wish to handle all the user GUI events in Java to evaluate different
commands in an Rengine.
With a GDCanvas, it's straightforward to get the x y position of a mouse
click with the standard e.getX() and e.getY()
So my handler would look like:
public void mouseClicked(MouseEvent e) {
System.out.println("Clicked" + e.getX() + " " + e.getY());
System.out.println(re.eval("t = trellis.focus()"));
System.out.println(re.eval("t"));...
2006 Apr 07
3
Pointer position on keypress event?
Hi.
Is there any straightforward way to tell pointer position (x, y)
upon keypress? In original wxWidgets, wxKeyEvent supports GetX()
and GetY() methods, but wxRuby''s KeyEvent object does not have
one. I also checked with event.methods and event.instance_variables.
Do I need to keep track of pointer position by evt_motion?
--
Taisuke Yamada <tyamadajp@spam.rakugaki.org>, http://rakugaki.org/
2268 E9A2 D4F9 014E...
2006 Jan 02
2
mouse position without event
Hello,
Is it possible somehow to get mouse coordinates without using the event
mechanism ?
I need to get the current mouse position to initialize some div position,
but not at page load
Tarek
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
2011 Aug 03
1
NAMESPACE problems
...existing function
Error : unable to load R code in package 'Brobdingnag'
ERROR: lazy loading failed for package ?Brobdingnag?
* removing ?/Users/rksh/packages/Brobdingnag.Rcheck/Brobdingnag?
wt118:~/packages%
AFAICS, all the setGeneric() calls are pretty much like this:
setGeneric("getX",function(x){standardGeneric("getX")})
Can anyone advise?
thank you
Robin
--
Robin Hankin
Uncertainty Analyst
hankin.robin at gmail.com
2011 Oct 24
0
R.oo package: do setMethodS3 work upon construction
...gramming!
Example 1:
setConstructorS3("ClassA", function() {
this = extend(Object(), "ClassA",
.x=NULL
)
this$xOne() # this is useful!!!!!!!!!!!!!
this
})
setMethodS3("xOne", "ClassA", function(this,...) {
this$.x = 1
})
setMethodS3("getX", "ClassA", function(this,...) {
this$.x
})
So x is always 1:
> a = ClassA()
> a$x
[1] 1
If you are new to R.oo: if you only want x to be 1 (I.e. xOne above is
simple) you should do something like this:
Example 2:
setConstructorS3("ClassA", function() {
thi...
2011 Sep 22
1
R.oo: do work on data member at construction
...mber
'z' upon construction? I'm thinking if .z=paste(x,y) below gets more complex
I'll run into issues.
setConstructorS3("MyClass", function(x=NA,y=NA,...) {
this <- extend(Object(), "MyClass",
.x=x,
.y=y,
.z=paste(x,y)
)
})
setMethodS3("getX", "MyClass", function(this, ...) {
this$.x;
})
setMethodS3("getY", "MyClass", function(this, ...) {
this$.y;
})
setMethodS3("getZ", "MyClass", function(this, ...) {
this$.z;
})
> mc = MyClass('a','b')
> mc$x
[1] &qu...
2006 Sep 12
1
Patch to wxMouseEvent.h
This patch just applies some const tags that were missing (does this
affect anything at all?) and removes a definition that was causing a
conflict.
Roy
_______________________________________________
wxruby-users mailing list
wxruby-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/wxruby-users
2009 Dec 22
1
RGtk2 - retrieve ggraphics mouse coordinates during drag-and-drop event
...- h$x; y <- h$y
xStart <<- x; yStart <<- y
pressed <<- TRUE
print(c("pressed at:", c(x,y)))
})
da <- g at widget@widget
callbackID <- gSignalConnect(da,"button-release-event", function
(w,e,...) {
allocation = w$GetAllocation()
xclick = e$GetX()
yclick = e$GetY()
x = xclick/allocation$width
y = (allocation$height - yclick)/allocation$height
xyCoordsRelease <- pltToUsr(x,y)
print(c("released at:", pltToUsr(x,y)))
xMove <- xyCoordsRelease[1] - xStart
yMove <- xyCoordsRelease[2] - yStart
print(c("xMove",...
2007 Jun 28
0
[1094] trunk/wxruby2: Added SetCursorEvent and mapping
...mith
+// released under the MIT-style wxruby2 license
+
+#if !defined(_wxSetCursorEvent_h_)
+#define _wxSetCursorEvent_h_
+
+class wxSetCursorEvent : public wxEvent
+{
+public:
+ wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0);
+ wxSetCursorEvent(const wxSetCursorEvent & event);
+
+ wxCoord GetX() const;
+ wxCoord GetY() const;
+
+ void SetCursor(const wxCursor& cursor);
+ const wxCursor& GetCursor() const;
+ bool HasCursor() const;
+
+ virtual wxEvent *Clone() const;
+};
+
+#endif
</ins></span></pre>
</div>
</div>
</body>
</html>
2007 Jul 04
0
[1107] trunk/wxruby2: Add the 2.8 get_modifiers method to KeyEvent; remove some deprecated
...27:15 UTC (rev 1106)
+++ trunk/wxruby2/swig/classes/include/wxKeyEvent.h        2007-07-04 19:32:50 UTC (rev 1107)
</span><span class="lines">@@ -15,6 +15,7 @@
</span><span class="cx"> long GetX() const;
</span><span class="cx"> long GetY() const;
</span><span class="cx"> bool MetaDown() const;
</span><ins>+ int GetModifiers() const;
</ins><span class="cx"> wxPoint GetPosition() const;
</span><spa...
2010 May 19
8
Generating all possible models from full model
Is there a function that will allow me to run all model iterations if I specify a full model? I am using information criteria to choose between possible candidate models. I have been writing out all possible model combinations by hand, and I am always worried that I am missing models or have made a mistake somewhere. It is also difficult to alter models if I want to change a term. For example,