Displaying 20 results from an estimated 20000 matches similar to: "Learning S3"
2006 Jan 01
4
S3 vs. S4
Dear R People:
Could someone direct me to some documentation on the
difference between S3 and S4 classes, please?
For example, why would a person use one as opposed to another?
Maybe pros and cons of each?
Thanks in advance!
R Version 2.2.0 (I'm downloading the new one this afternoon!) Windows.
Happy New Year!
Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and
2012 Jan 17
2
Which date format to choose?
R offers a bewildering array of options when it comes to representing
dates and times (e.g, as.Date, chron, strptime, zoo, etc). Can anybody
recommend a document that compares the relative merit of each method? I'm
not looking for help with any one method, but rather a guide that
describes which method is best for a particular data analysis/plotting
goal.
Thanks,
Jake
[[alternative
2007 Apr 05
1
Extent of time zone vulerability for POSIX date and time classes
Hi.
I frequently convert date and time data to and from character
representations. I'm frustrated with chron, because 'seconds' are
required to create a time object (my input data never has seconds).
More importantly, I cannot make chron print the format 12/30/2006 (which
my output data requires).
I really like the format flexibility of strftime() and strptime(), but
of course
2008 Feb 16
3
Arithmetic bug? (found when use POSIXct) (PR#10776)
Full_Name: Bo Zhou
Version: 2.6.1 (2007-11-26)
OS: Windows XP
Submission from: (NULL) (207.237.54.242)
Hi,
I found an arithmetic problem when I'm doing something with POSIXct
The code to reproduce it is as follows (This is the recommended way of finding
out time zone difference on R News 2004-1 Page 32 URL
http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf)
a=Sys.time()
2005 Nov 29
2
qcc
violating.runs
I read from the news
cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf
that the criteria for the violating is 5 but
1)I cannot find "5" in the code of the function. Where is the "5" ?
2)What is the easiest way to change it ?
3)Is there any more criterias made somewhere ?
Yours sincerelly, Tommi Viitanen
2017 Aug 08
0
Inheritance for S3 classes
You might find http://adv-r.hadley.nz/s3.html to be helpful (in
particular, http://adv-r.hadley.nz/s3.html#constructors-1, gives my
advice about subclass constructors)
Hadley
On Mon, Aug 7, 2017 at 7:06 PM, Kym Nitschke <kym.nitschke at icloud.com> wrote:
> Hi R Users,
>
> I am relatively new to programming in R ? so I apologise if my questions appear ?dumb?.
>
> I am using
2017 Aug 08
4
Inheritance for S3 classes
Hi R Users,
I am relatively new to programming in R ? so I apologise if my questions appear ?dumb?.
I am using a package that defines a number of S3 classes. I want to create an S3 child class of one of these classes. The parent class has a contractor with many arguments. I have been having difficulty writing the child class contractor. I have been unable to find a good reference in the internet
2009 Feb 04
2
Capturing all warnings (with messages)
Dear all,
For an open-source project that I'm working on (1), which uses R for
all its heavy lifting but includes a wrapper shell script, I was
hoping to find a way to capture all warnings (and, in fact, errors
too), and handle them in my own way. I realise I can do this for a
single expression using something like:
> f <- function(w) print(w$message)
>
2009 Dec 22
1
as.Date function yields inconsistent results (PR#14166)
Full_Name: Mario Luoni
Version: 2.10.0
OS: Windows XP HE SP3
Submission from: (NULL) (217.194.59.134)
This piece of code:
zzz1 <- as.POSIXct("1999-03-18", tz="CET")
zzz2 <- as.POSIXlt("1999-03-18", tz="CET")
zzz1 == zzz2
as.Date(zzz1)
as.Date(zzz2)
yields TRUE for "zzz1==zzz2", but the two dates returned by as.Date are
different:
>
2004 Sep 03
2
strptime problems
Hi, I'm experiencing a problem with strptime. (R 1.9.1 on a Win2000
machine)
I have a large list containing 6 columns and 161800 rows.
One column contains dates that I want to convert in order to compare the
different dates.
Some dates work just fine while others become NA. I don't see any
difference between the dates.
I've attached an example from my code. Hope this explains my
2013 Jun 19
2
str and s3 classes
Hi all,
Because str uses the generic version of length and names, it's
currently very easy to create objects that break str:
a <- structure(list(1:5), class = "a")
length.a <- function(x) 2L
str(a)
b <- structure(list(1:5), class = "b")
names.b <- function(x) character()
str(b)
These are obvious toy examples, but it is a real problem if you want
to create
2010 Sep 01
1
S3 method for package listed in suggest/enhance
Hi all,
The profr package provides a method for displaying its output with
ggplot: ggplot.print. You don't need this ggplot2 to use profr, so
ggplot2 is listed under enhances in the DESCRIPTION file.
If I have just S3method(ggplot, profr) in my NAMESPACE, then I get:
** testing if installed package can be loaded
Error : object 'ggplot' not found whilst loading namespace
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
2016 Apr 19
4
S3 dispatch for S4 subclasses only works if variable "extends" is accessible from global environment
Does it make sense to be able to load an S4 object without the methods
package being attached? I'm not sure implementation-wise how easy this
would be, but it seems like any time there is an S4 object around, the
methods package should be available to deal with it.
~G
On Tue, Apr 19, 2016 at 7:34 AM, Michael Lawrence <lawrence.michael at gene.com
> wrote:
> Right,
2004 Aug 18
1
Fwd: strptime() problem? - Resolved
Hi Gabor and everybody;
Thanks Gabor, with the alternative step you've told me the problem is
resolved. Comparing the two procedures:
Extract from the source 'character' data:
> rain$ts[2039:2046]
[1] "25/03/2000 22:00:00 UTC" "25/03/2000 23:00:00 UTC"
[3] "26/03/2000 00:00:00 UTC" "26/03/2000 01:00:00 UTC"
[5] "26/03/2000 02:00:00
2018 Dec 09
2
Clases S3, S4...
Y para completar, también existen las reference class o las más modernas
R6. https://adv-r.hadley.nz/r6.html
Que se parecen más a los lenguajes más orientados a objetos, con sus
herencias y demás historias.
dom., 9 dic. 2018 17:23, Carlos J. Gil Bellosta <cgb en datanalytics.com>
escribió:
> Hola, ¿qué tal?
>
> S3 es un sistema de clases bastante primitivo. Está pensado
2015 Jul 27
2
Método S3 paquete
Hola Carlos,
Muchas gracias por el enlace, me ha sido de gran ayuda. Ya he entendido
cómo funciona el sistema S3.
Un saludo,
Guillermo
> Hola, ¿qué tal?
>
> Sigue
http://www.datanalytics.com/2011/08/04/desarrollo-de-paquetes-con-r-iv-funciones-genericas/
> a rajatabla y lo tendrás.
>
> Un saludo,
>
> Carlos J. Gil Bellosta
> http://www.datanalytics.com
>
>
2020 Jan 21
2
class(<matrix>) |--> c("matrix", "arrary") -- and S3 dispatch
Dear Martin,
What's the ETA for _R_CLASS_MATRIX_ARRAY_=TRUE to become the new
unconditional behavior in R devel? Thanks!
H.
On 11/21/19 08:57, Martin Maechler wrote:
>
> TLDR: This is quite technical, still somewhat important:
> 1) R 4.0.0 will become a bit more coherent: a matrix is an array
> 2) Your package (or one you use) may be affected.
>
>
2013 Aug 24
2
Correct NAMESPACE approach when writing an S3 method for a generic in another package
Dear List,
In one of my packages I have an S3 method for the plot3d generic
function from package rgl. I am trying to streamline my Depends
entries but don't know how to have
plot3d(foo)
in the examples section for the plot3d method in my package, without
rgl being in Depends.
Note that I importFrom(rgl, plotd3d) and register my S3 method via
S3Method() in the NAMESPACE.
If rgl is not in
2010 Feb 11
2
ZOO object colnames refering to Dates
Hello,
I have large zoo objects (about 100 or more time series merged next to
eachother). Example:
X05.Oct.99 X05.Nov.99 X05.Dec.99 X05.Jan.00 X05.Feb.00 X05.Mar.00
X05.Apr.00 X05.May.00 X05.Jun.00
[1,] 5649.3 5679.4 5679.4 5679.4 5679.4
5679.4 5679.4 5679.4 5679.4
[2,] 5682.7 5719.2 5719.2 5719.2 5719.2
5719.2 5719.2
2018 Dec 09
3
Clases S3, S4...
Buenas
Desde hace ya bastante tiempo veo viendo que hay diferentes tipos de clases en R, las mas viejas, S3, y luego algunas mas modernas como S4,... ?Que diferencias existen entre estas clases? Alguna buena referencia la respecto, que sea entendible por un profano de la informatica?=
Gracias
Jes?s
[[alternative HTML version deleted]]