search for: reclassed

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

Did you mean: reclasses
2009 Dec 04
2
Class attributes
Dear R forum, I want to replace all the elements in a data frame (dd) which match the character "x" with "0". What's the most elegant way of doing this (there must be an easy way which I've missed)? I settled on the following loop: >for(i in 5:12){ # These are the column of dd I am interested in >dd[which(dd[,i]=="x"),i]<-0 >} The
2023 Apr 28
2
range() for Date and POSIXct could respect `finite = TRUE`
Hi all, I noticed that `range.default()` has a nice `finite = TRUE` argument, but it doesn't actually apply to Date or POSIXct due to how `is.numeric()` works. ``` x <- .Date(c(0, Inf, 1, 2, Inf)) x #> [1] "1970-01-01" "Inf" "1970-01-02" "1970-01-03" "Inf" # Darn! range(x, finite = TRUE) #> [1] "1970-01-01"
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`
A tiny nit-pick: Seems to me that end date = NA would mean the event has not yet ended, whilst Inf would mean that the event is known to never terminate, ie: an eternal fact, or physical law. On Fri, Apr 28, 2023 at 10:12?AM Davis Vaughan via R-devel < r-devel at r-project.org> wrote: > Hi all, > > I noticed that `range.default()` has a nice `finite = TRUE` argument, > but it
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 delet...
2023 May 19
1
range() for Date and POSIXct could respect `finite = TRUE`
Hi All, I think there may be some possible confusion about what allowsInf would be reporting (or maybe its just me :) ) if we did this. Consider a class "myclass", S3, for starters, with setMethod("allowsInf", "myclass", function(obj) FALSE) Then, what would myclassthing <- structure(1.5, class = "mything") myclassthing[1] <- Inf do. Assumely it
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