search for: reclass

Displaying 10 results from an estimated 10 matches for "reclass".

Did you mean: regclass
2009 Dec 04
2
Class attributes
...ain "x" are still considered factors and I am unable to coerce them into numeric: > mean.species.biomass<-colMeans(as.numeric(dd.p[,5:12])) >Error in inherits(x, "data.frame") : (list) object cannot be coerced to type 'double' I'm tried unclassing & reclassing, other functions etc. but nothing seems to work. What is wrong? Thanks in advance, Allen -- View this message in context: http://n4.nabble.com/Class-attributes-tp948693p948693.html Sent from the R help mailing list archive at Nabble.com.
2023 Apr 28
2
range() for Date and POSIXct could respect `finite = TRUE`
...; "2019-01-09" #> [6] "2019-01-10" "2019-01-11" "2019-01-12" "2019-01-13" "2019-01-14" ``` It seems like one option is to create a `range.Date()` method that unclasses, forwards the arguments on to a second call to `range()`, and then reclasses? ``` range.Date <- function(x, ..., na.rm = FALSE, finite = FALSE) { .Date(range(unclass(x), na.rm = na.rm, finite = finite), oldClass(x)) } ``` This is similar to how `rep.Date()` works. Thanks, Davis Vaughan
2004 Mar 15
2
R equiv to proc gremove in maps package
Is there an R equivalent to SAS's proc gremove? You would use this procedure to combine the units on an existing map, for example to build a map of Metropolitan Statistical Areas (MSAs) from the [US] counties dataset where the internal boundries surround the MSAs (which are groups of counties) rather than the individual counties. I can imagine the mechanism would be to find and erase the
2023 Apr 28
1
range() for Date and POSIXct could respect `finite = TRUE`
...#> [6] "2019-01-10" "2019-01-11" "2019-01-12" "2019-01-13" "2019-01-14" > ``` > > It seems like one option is to create a `range.Date()` method that > unclasses, forwards the arguments on to a second call to `range()`, > and then reclasses? > > ``` > range.Date <- function(x, ..., na.rm = FALSE, finite = FALSE) { > .Date(range(unclass(x), na.rm = na.rm, finite = finite), oldClass(x)) > } > ``` > > This is similar to how `rep.Date()` works. > > Thanks, > Davis Vaughan > > _________________...
2019 Mar 26
0
Discrepancy between is.list() and is(x, "list")
...s just the non-devel R I had handy, and you had seemed to be presenting it as something new in 3.5.3. I would be surprised if the behavior doesn't go all the way back to whenever head.function was added. Before that head() on a function (likely) would have failed just like it still does on your reclassed function. Because, again, this is how S3 is supposed to behave when you give it the inputs you are. I fyou want your f class to hit function S3 methods, you need to do class(myfun) <- c("f", "function") Then everything will work. Best, ~G [[alternative HTML version del...
2023 May 19
1
range() for Date and POSIXct could respect `finite = TRUE`
...; >> >> >> > >> >> >> > It seems like one option is to create a `range.Date()` > >> >> >> > method that unclasses, forwards the arguments on to a > >> >> >> > second call to `range()`, and then reclasses? > >> >> >> > >> >> >> > ``` range.Date <- function(x, ..., na.rm = FALSE, finite = > >> >> >> > FALSE) { .Date(range(unclass(x), na.rm = na.rm, finite = > >> >> >> > finite), oldClass(...
2019 Mar 26
4
Discrepancy between is.list() and is(x, "list")
If I can merge this thread with the one I started yesterday... > "If the object does not have a class attribute, it has an implicit class..." > which I take to mean that if an object does have a class attribute it does not also have an implicit class. > I think this is reasonable behavior. Consider the "Date" class, which stores values as "numeric": >
2009 Mar 10
4
puzzled by math on date-time objects
Hi, I don't understand the following. When I create a small artificial set of date information in class POSIXct, I can calculate the mean and the median: a = as.POSIXct(Sys.time()) a = a + 60*0:10; a [1] "2009-03-10 11:30:16 EDT" "2009-03-10 11:31:16 EDT" "2009-03-10 11:32:16 EDT" [4] "2009-03-10 11:33:16 EDT" "2009-03-10 11:34:16
2011 Feb 08
4
manipulating the Date & Time classes
Hello, This is mostly to developers, but in case I missed something in my literature search, I am sending this to the broader audience. - Are there any plans in the works to make "time" classes a bit more friendly to the rest of the "R" world? I am not suggesting to allow for fancy functions to manipulate times, per se, or to figure out how to properly
2011 Feb 08
4
manipulating the Date & Time classes
Hello, This is mostly to developers, but in case I missed something in my literature search, I am sending this to the broader audience. - Are there any plans in the works to make "time" classes a bit more friendly to the rest of the "R" world? I am not suggesting to allow for fancy functions to manipulate times, per se, or to figure out how to properly