Displaying 20 results from an estimated 2000 matches similar to: "editing import data, strings"
2011 Jan 01
2
Problem with uploading library
Hello.
I'm new on that forum, so I would use some help... I'm programing with R
program, have some exercise to do.
So here it goes.
1. I have to upload two libraryes "sp" and "maptools"
2. This command is troubling me : towns <- readShapeSpatial("OB/OB.shp")
3. When I'm pressing f5, there is an error called: Error: could not find
function
2011 Jan 26
3
Need help with my homework
Hello to all again :)
Again, I have an issue with my homework. I was troubling myself for two
days, and I still can't get it :(
So, if someone can help me, I would be so grateful...
HOMEWORK 1.
I need to draw function,
random walk take the length of walk, and its in 2D. As a result, I have to
take matrix in which are i-lines of matrix, written coordinates on i-steps
radnom.walk <-
2008 Mar 07
9
What constitutes a good backtrace?
Hi all,
I did my first bug report in a while. Unfortunately the good folks
at wineHQ.org didn't like it much because Gentoo by default stripped
out much of the backtrace info. I've recompiled Wine with more
backtrace capabilities in it and am wondering what's considered good
enough.
Below are two backtraces. They may or may not be exactly the same
failure but they both come from
2003 Jan 13
4
Ideas needed on automation of R
I need some guidance on what is the best way to automate R I am aware of
Rterm.
First question: Is it true that R is not currently OLE accessible under
Windows 2000?
Second question: Is there an R command that echoes all R Console results to
a run log system file?
My first attempt to write a run log file is the example from the R Data
Inport/Export documentation.
> zz<-
2007 Mar 30
2
Replacing slot of S4 class in method of S4 class?
Dear all,
Assume that I have an S4 class "MyClass" with a slot "myname", which
is initialized to: myname="" in method("initialize"):
myclass <- new("MyClass", myname="")
Assume that class "MyClass" has a method "mymethod":
"mymethod.MyClass" <-
function(object, myname=character(0), ...) {
2020 May 12
4
S3 method dispatch for methods in local environments
Dear All,
In R 3.6.3 (and earlier), method dispatch used to work for methods stored in local environments that are attached to the search path. For example:
myfun <- function(y) {
out <- list(y=y)
class(out) <- "myclass"
return(out)
}
print.myclass <- function(x, ...) print(formatC(x$y, format="f", digits=5))
myfun(1:4)
# prints: [1]
2005 Dec 07
1
Dots argument in apply method
Hello everyone,
I'm working on a package using S4 classes and methods and I ran into the
following "problem" when I tried to create an "apply" method for objects
of one of my new classes. I've found a way around the problem but I
wonder if I did not paint myself into the corner. I'd like your opinion
about that.
So I have an object "myObj" of class
2019 Jul 07
3
Possible bug in `class<-` when a class-specific '[[.' method is defined
Hi all !
I noticed a strange behaviour of the function `class<-` when a class-specific '[[.' method is defined.
Here below a reproducible example :
#-------------------------------------------------------------------.
counttt <- 0
`[[.MYCLASS` = function(x, ...) {
counttt <<- counttt + 1
# browser()
x = NextMethod()
return(x)
}
df <- as.data.frame(matrix(1:20,
2011 Oct 31
1
Question about copying reference objects using the initialize method
Dears,
I have a question about copying reference objects using the initialize method.
1) If the latter has no arguments, there is no problem to copy an object.
myClass = setRefClass("myClass", fields = list(value = "numeric") )
myClass$methods(initialize = function(...){
? value <<- 1
? callSuper(...)
})
newObject = myClass$new()
newObject$value = 2
copyObject =
2000 Jun 26
2
nargs() inside "[.myclass"
I am writing a function to work with class I am defining. I have a question
about using nargs() inside of parentheses function. nargs() shows the same
for supplying 1 argument, or no arguments at all. Here is a small example:
> "[.myclass"<-function(x,...) print(nargs()-1)
> x<-c(1,2,3)
> class(x)<-"myclass"
> x[]
[1] 1
> x[1]
[1] 1
> x[1,2]
[1] 2
2002 Dec 12
1
improving ts object
Dear all,
Currently, a ts object behaves like an array, and it would be very useful to have a similar object, which would behave like a data.frame, i.e. it could be indexed, named, etc. like a data.frame. What would be the most efficient way to construct such an object? I have tried to make one on my own following the directions of class design from "S Programming" (2000) as a
2008 Dec 22
1
How to add a slot to S4 class of an existing package?
Dear all,
Since my package is based on S4 classes, I would like to know how to add
a slot to an existing S4 class without breaking the code of users of my
package.
Assume the following S4 class:
setClass("MyClass",
representation(name = "character",
type = "character",
data = "data.frame"
),
prototype(name =
2005 Jul 08
2
R.oo static field
How can I define a static member of a class? not a static method,
rather a static field that would be accessed by all instances of the
class.
2011 Sep 22
1
R.oo: do work on data member at construction
Hello,
I'd like to 'do work' on data members upon construction (i.e. without
implementing it in a get method). Is this the best way to create data member
'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",
2007 Oct 08
6
stub actions that depend on the parameter
Hi,
I''m pretty new to all related to bdd and rspec and I have the following
question. Is it possible to stub actions that return different objects
depending on the parameteres they were called with? Something like this:
MyClass.stub!(:method).with(1).and_return(@mock_object_1)
MyClass.stub!(:method).with(2).and_return(@mock_object_2)
I know I could use
2006 Feb 10
13
Element.observe () binding
Hey all,
I working on a project, but I am not sure I can do what I want to
do. The following works beautifully:
Event.observe(el, ''click'', function () { this.className += "
myClass"; return false; });
I have also tried doing this:
this.varname = ''test'';
Event.observe(el, ''click'', function () { alert (this.varname); }.bind
2011 Jun 06
1
Seeking help to define method for show() for an S4 object
Dear all, I have created a new S4 class with name "MyClass". Please see
below for it's definition. Now I want to create a
method for the show() function for this class. In defining this method, what
I want is, once user would like see an object of this class
some values will be displayed. Then R will ask for **press Enter**. Once
user presses enter then, remaining values will be
2012 Sep 21
2
[LLVMdev] Clang API parsing of the destructor
I am using the clang API (version 3.1 - trunk 153913) to compile some very simple code as follows
class MyClass
{
~MyClass() ;
};
MyClass::~MyClass()
{
}
int main()
{
return 0;
}
My problem is that I get the error message: test.cpp:20:10: error: destructor cannot have a return type MyClass::~MyClass()
If someone can point me to the right direction that would be great. It compiles fine if
2008 Mar 20
1
setMethod for "["
Hi R-Help,
Please consider the following simple case: I have a class like
setClass("myClass",
representation(x="matrix", y="character"))
and I would like to use the method *"["* for a *myClass* objects (but
changing the default *drop* argument from TRUE to FALSE):
setMethod("[","myClass",
function(x,i,j,...,drop=FALSE)
2009 Jan 02
1
"registering" a generic method for a class
Sorry in advance if this is too simple a question, but I'm stuck with
some odd behavior and I can't find the text to rid myself of this
(admittedly somewhat trivial) problem. Note that I've done generic
programming with S3 "objects" in the past, but I've never really
dabbled in creating S4 objects until now.
So, I've created a new S4 class, call it