Displaying 20 results from an estimated 3000 matches similar to: "help with converting a data frame into object of class "track""
2010 Dec 08
1
on NMDS graphics
Hi,
I have used Vegan to construct an NMDS ordination plot. I plotted sites of
three forest types with the site number in it. My reviewer has asked me to
use different symbols for each of the forest types.
Can anyone send me how I can do this in R in simple steps. I have used the
options like ordiplot, sel and pl syntaxes that are not working for the
question that I asked for.
Best,
Sinu
--
2008 Mar 17
1
setAs vs setIs
Hi the list
I am fighting with the twins setAs and setIs...
Here are some questions and comments (comments to myself but that migth
be wrong, it is why I am posting them)
1. Very surprising : using setIs define 'is', 'as<-' but not 'as' ???
2. Using setAs define 'as', 'as<-' but not 'is'...
What surprise me is that as<- can be define by
2020 Oct 06
0
S4 - inheritance changed by order of setClassUnion and setAs()
Andreas,
As far as I can tell (/conjecture), this is because the list of classes a
particular class inherits from directly is appended to as needed, and so
the order that a class extends others isd refined by the order that those
connections are defined.
We can see this with two setClassUnion calls, rather than required setAs:
> setClass("grandma", slots = c(a =
2005 Mar 29
0
setAs between a new S4 class and "POSIXlt"
Dear R core team
Please apologize for posting the same question twice on R-help and
R-devel. Since I was not sure which list is appropriate I tried R-help (Tue
Mar 22), but got no answer.
Now I do not know if the formulation of my question was unclear or the
question is not so easy to answer or to easy (what I do not hope).
My problem: I create a new S4 class, containing one slot, data (of
2009 Nov 03
1
help with SSOAP (can't find working examples)
First of all, let me confess that I am a newbie to R and don't know
much about the language or the environment. We have a need for
plugging in R in our production runtime and need the ability to pull
data out of our existing services. I am trying to see if I can take
advantage of SSOAP such that we can expose the data via webservices
and use SSOAP to call into them. Our runtime is mostly
2005 Mar 22
0
setAs between a new S4 class and "POSIXlt"
Dear R gurus
I've a question concerning the transformation of a new S4 class
(that I defined) and the existing class "POSIXlt". I did the
following:
## Definition of the new class:
setClass("dtime",
representation(data = "POSIXlt"),
prototype(data = as.POSIXlt("2004/06/01")))
## Transformation between the new class "dtime"
2003 Sep 28
1
infinite recursion during package installation with methods, setAs
I ran into a problem recently trying to update a package which uses S4
methods using a recent beta of R. I think I can reproduce it with a
simple example. I have package called `testpkg' in directory testpkg/.
In the R/ subdirectory of testpkg/ I have a file called testpkg.R which
contains the following two lines:
setClass("testpkg", representation(pts = "list"))
2004 Nov 26
1
Namespaces, coercion and setAs
I'm trying to resolve a small problem that has arisen from introducing a
NAMESPACE for the package SparseM. Prior to the namespace I had
a class "matrix.diag.csr" that consisted of diagonal sparse matrices.
It
was defined to have the same attributes as the matrix.csr class and
setAs
was used to define how to coerce integers and vectors into this form:
2020 Oct 05
2
S4 - inheritance changed by order of setClassUnion and setAs()
Dear colleagues,
there is a behaviour with S4 (virtual) classes that I find very hard to understand: Depending on the position
of setAs(), the tree of inheritance changes.
This is my baseline example that defines the classes "grandma", "mother", "daughter" and a virtual
class "mr_x". For a new instance if "daughter", "mr_x" is betweeen
2011 Dec 04
0
How to write (complex) coercion methods or "what's the reason to limit 'setAs()' the way it is limited"?
Dear list,
I'd like to write coercion methods for some of my Reference Classes.
However, using 'setAs()' is not a real option as its argument 'def' only
allows for functions depending on one single argument. In some cases,
that is simply too much of a limitation for me. And I don't really see
why it needs to be this way, so I guess this question is also some sort
of a
2003 Sep 08
0
setAs() and namespaces
An example sent by Ross Ihaka points out a non-obvious step needed to
export the results of setAs().
The as() mechanism can't use ordinary method dispatch because the second
argument is the name of a class, not an object from the class. So it
uses a "helper" function, coerce(), and sets methods for that function.
Therefore, if you want to export the results of setAs(), at the
2004 Oct 08
0
user interface and documentation of setIs and setAs, some suggestions (S4).
By reading the documentation for _setIs_ I noted that for the same
object three different names are used.
1) the name of the first argument in the functions coerce and replace in
setIs must be _obj_ (see example section or)
setIs("MVCa","list",coerce=function(obj){obj@list},replace=function(obj,value){obj@list<-value})
2) At the same time in the usage section:
2005 Feb 10
1
Undocumented S4 methods: generic coerce and siglist matrix, Massvector
Hi,
While checking the package I am getting all the time the following
complain about the function:
Undocumented S4 methods:
generic coerce and siglist matrix,Massvector
I have not defined the function nowhere in the R files.
My gues is that this has something to do with the following definition
of the setAs function.
setAs("matrix","Massvector"
,def=
2004 Sep 08
1
A couple of issues with colClasses/setAs
Consider this:
$ cat test.dat
1 a
2 b
Now, we want to read the 2nd column as a factor and ignore the first
(since it's just a sequential ID). We can't just put "factor" among
the colClasses (would have been nice), so let's try this instead
> setAs("character","factor",as.factor)
Arguments in definition changed from (x) to (from)
>
2007 Jul 16
1
S4 coerce
(I am not sure if this is a bug or a request for a more understandable
warning, or possible something obvious I should be posting on r-help.)
I am trying to coerce an new class object to be a DBIConnection and it
does not work the way I think it should:
R version 2.5.1 (2007-06-27) ...
> require("RMySQL") # or require("RSQLite")
Loading required package: RMySQL
Loading
2007 Apr 15
0
as() creates invalid entries in methods list?
Hi,
We've observed rather strange behavior related to as(). When as() is
used to make a conversion to a super class, an invalid entry is
inserted into the table of methods.
> setClass("A", contains="list")
> get(".MTable", environment(coerce))[["list#A"]]
NULL
> as(list(), "A")
> get(".MTable",
2009 Aug 05
1
S4 method dispatch: coercion of arguments with setAs defined
Hi list,
I've got a class B that contains a slot obj of class A. I'd like to be
able to call all the methods of class A directly on objects of class B
as if I had called the method on slot obj. This without overloading all
methods of class A to work on class B.
I don't define B as an extension of A, because I want class B to also
work with objects of classes that inherit from
2002 May 29
1
warning message for setAs when using class AsIs
This seemed too advanced for r-help and is related to the recent discussion of
character vectors in dataframes.
Following Brian Ripley's most excellent advice, we are moving to a world in
which character vectors in dataframes are always of class AsIs. The cool way of
doing this seemed to be the following:
> cat(c("x", "y", "z"), file = "test.txt",
2008 Aug 18
0
New packages bpca: biplot (2d and 3d) and diagnostic tools
Dear R Community,
We am pleased to announce the release of the 'bcpa' package. The
source code and binaries is now on CRAN
(http://cran.r-project.org/web/packages/bpca/index.html).
The bpca package implements biplot (2d and 3d) and diagnostic tools of
the quality of the reduction.
It depends R (>= 2.6.0), scatterplot3d, rgl and MASS packages.
Regards,
--
2004 Sep 07
2
package methods different behaviour R1.9.1 patched and R2.0.0
Hi!
Concerning different behaviour between 1.9.1 patched and:
R : Copyright 2004, The R Foundation for Statistical Computing
Version 2.0.0 Under development (unstable) (2004-09-06), ISBN 3-900051-07-0
Subtitle:
as(x,"vector"); x is of class "Massvector"; never enters setAs("Massvector","vector"...
The same code:
as(mvl[[1]],"vector")
causes