search for: getdatapart

Displaying 13 results from an estimated 13 matches for "getdatapart".

2010 Jul 12
1
S4 class extends "data.frame", getDataPart sees "list"
...(dS4) [1] "data.frame" # good attr(,"package") [1] "methods" > setClass("A", representation(label="character"), contains="data.frame") [1] "A" > a<-new("A",dS4, label="myFrame") > getDataPart(a) [[1]] # oh? [1] 1 2 3 > class(a@.Data) [1] "list" # hmm > names(a) [1] "x" # sure, that makes sense > a Object of class "A" x 1 1 2 2 3 3 Slot "label": [1] &...
2006 Feb 27
0
method dispatch and in-place modification? - unclass, RemoveClass, getDataPart, method dispatch
...use of this code. */ I came upon "RemoveClass()" in R/src/main/object.c which says it is __unused__ but seems to do what I would like it to do. So I tried a S4 method dispatch mechanism, but it is 3 times *slower* than unclass, and it seems to be due to the switch() statement inside getDataPart() (in R/src/library/methods/R/RClassUtils.R) which typically copies the object three times? (I think "attributes(value) <- NULL" also copies) > getDataPart <- > function (object) > { > ... > switch(dataPart, ... > array = { > valu...
2015 Dec 11
3
For integer vectors, `as(x, "numeric")` has no effect.
...setClass("NN", representation(x="numeric")) (m1 <- myN (1:3)) (m2 <- myNid(1:3, id = "i3")) tools::assertError(NN (1:3))# in all R versions ## # current R | new R ## # -----------|---------- class(getDataPart(m1)) # integer | numeric class(getDataPart(m2)) # integer | numeric In other words, with the above setting, the traditional gentleperson's agreement in S and R, __ "numeric" sometimes conveniently means "integer" or "double" __ will be slightly le...
2008 Dec 16
1
Problem with alignDailySwries in R-metrics
...n; charset=UTF-8' length 248392 bytes (242 Kb) opened URL downloaded 242 Kb Read 13060 items class(DTB6) [1] "timeSeries" attr(,"package") [1] "fSeries" DTB6<-alignDailySeries(DTB6, method = "interp",include.weekends = FALSE, units = NULL) Error in getDataPart(<S4 object of class "timeSeries">) : no '.Data' slot defined for class "timeSeries" What's causing this error? --John sessionInfo() R version 2.8.0 (2008-10-20) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States...
2008 Aug 07
1
'"ts" treated as a registered S3 class, but keep its "structure" behaviour' ?
...neric(e1 at .Data, e2 at .Data) header <- paste(e1 at header, e2 at header, sep = "_") new("foo", .Data, header = header) }) foo <- new("foo", 1:10, header = "foo") foo + foo ts <- ts(1:10) foo / ts # Error in getDataPart(1:10) : no '.Data' slot defined for class "ts" Is this the expected behavior? regards, Yohan -- PhD student Swiss Federal Institute of Technology Zurich www.ethz.ch
2015 Dec 12
2
For integer vectors, `as(x, "numeric")` has no effect.
...>> (m1 <- myN (1:3)) >> (m2 <- myNid(1:3, id = "i3")) >> tools::assertError(NN (1:3))# in all R versions >> >> ## # current R | new R >> ## # -----------|---------- >> class(getDataPart(m1)) # integer | numeric >> class(getDataPart(m2)) # integer | numeric >> >> >> In other words, with the above setting, the traditional >> gentleperson's agreement in S and R, >> >> __ "numeric" sometimes...
2015 Dec 11
0
For integer vectors, `as(x, "numeric")` has no effect.
...sentation(x="numeric")) > > (m1 <- myN (1:3)) > (m2 <- myNid(1:3, id = "i3")) > tools::assertError(NN (1:3))# in all R versions > > ## # current R | new R > ## # -----------|---------- > class(getDataPart(m1)) # integer | numeric > class(getDataPart(m2)) # integer | numeric > > > In other words, with the above setting, the traditional > gentleperson's agreement in S and R, > > __ "numeric" sometimes conveniently means "integer" or "doub...
2015 Dec 19
2
For integer vectors, `as(x, "numeric")` has no effect.
...(1:3)) >>>> (m2 <- myNid(1:3, id = "i3")) >>>> tools::assertError(NN (1:3))# in all R versions >>>> >>>> ## # current R | new R >>>> ## # -----------|---------- >>>> class(getDataPart(m1)) # integer | numeric >>>> class(getDataPart(m2)) # integer | numeric >>>> >>>> >>>> In other words, with the above setting, the traditional >>>> gentleperson's agreement in S and R, >>>> >>>> __ &...
2015 Dec 08
2
For integer vectors, `as(x, "numeric")` has no effect.
We do need an explicit method here, I think. The issue is that as() uses methods for the generic function coerce() but cannot use inheritance in the usual way (if it did, you would be immediately back with no change, since "integer" inherits from "numeric"). Copying in the general method for coercing to "numeric" as an explicit method for "integer" gives
2015 Dec 19
0
For integer vectors, `as(x, "numeric")` has no effect.
...(1:3)) >>> (m2 <- myNid(1:3, id = "i3")) >>> tools::assertError(NN (1:3))# in all R versions >>> >>> ## # current R | new R >>> ## # -----------|---------- >>> class(getDataPart(m1)) # integer | numeric >>> class(getDataPart(m2)) # integer | numeric >>> >>> >>> In other words, with the above setting, the traditional >>> gentleperson's agreement in S and R, >>> >>> __ &...
2015 Dec 26
0
[Bioc-devel] For integer vectors, `as(x, "numeric")` has no effect.
...> (m2 <- myNid(1:3, id = "i3")) >>>>> tools::assertError(NN (1:3))# in all R versions >>>>> >>>>> ## # current R | new R >>>>> ## # -----------|---------- >>>>> class(getDataPart(m1)) # integer | numeric >>>>> class(getDataPart(m2)) # integer | numeric >>>>> >>>>> >>>>> In other words, with the above setting, the traditional >>>>> gentleperson's agreement in S and R, >>>>>...
2011 Mar 11
1
dataframe to a timeseries object
I?m wondering which is the most efficient (time, than memory usage) way to obtain a multivariate time series object from a data frame (the easiest data structure to get data from a database trough RODBC). I have a starting point using timeSeries or xts library (these libraries can handle time zones), below you can find code to test. Merging parallelization (cbind) is something I?m thinking at
2016 Jan 05
2
For integer vectors, `as(x, "numeric")` has no effect.
...(1:3)) >>>> (m2 <- myNid(1:3, id = "i3")) >>>> tools::assertError(NN (1:3))# in all R versions >>>> >>>> ## # current R | new R >>>> ## # -----------|---------- >>>> class(getDataPart(m1)) # integer | numeric >>>> class(getDataPart(m2)) # integer | numeric >>>> >>>> >>>> In other words, with the above setting, the traditional >>>> gentleperson's agreement in S and R, >>>> >>>> __ &quo...