ere the pairwise comparison is obvious, while the numeric
conversion isn't.
A simple one would be a list of string vectors of different lengths,
where you want to sort lexicographically.
Duncan
Have fun with the remainder of the advent!
Another Martin
From: R-help on behalf of Martin Møller Skar
h for S3 generics), but rather define a
class (e.g., that requires vectors person and value) and implement a
corresponding `xtfrm()` method.
Have fun with the remainder of the advent!
Another Martin
From: R-help on behalf of Martin Møller
Skarbiniks Pedersen
Date: Thursday, December 14, 2023
On Thu, 14 Dec 2023 at 12:02, Duncan Murdoch wrote:
>
> class(df$value) <- "sizeclass"
>
> `>.sizeclass` <- function(left, right) custom_sort(unclass(left),
> unclass(right)) == 1
>
> `==.sizeclass` <- function(left, right) custom_sort(unclass(left),
> unclass(right)) == 0
>
> `[.sizeclass` <- fu
> This sounds suspiciously like homework (which is off-topic... see the Posting
> Guide)
It is not homework.
Currently I am trying to solve this: https://adventofcode.com/2023/day/7
But it is something that has puzzled me for a long time.
In many programming languages, you can give a "less" func
On 14/12/2023 3:00 a.m., Martin Møller Skarbiniks Pedersen wrote:
Hi,
I need to sort a data.frame based on a custom sorting function.
It is easy in many languages but I can't find a way to do it in R.
In many cases I could just use an ordered factor but my data.frame
contains poker han
This sounds suspiciously like homework (which is off-topic... see the Posting
Guide), and you haven't indicated how you plan to encode your poker hands, and
most core features of other languages are possible in R so if you really
understand these other techniques and R then you should be able to
Hi,
I need to sort a data.frame based on a custom sorting function.
It is easy in many languages but I can't find a way to do it in R.
In many cases I could just use an ordered factor but my data.frame
contains poker hands and
I need to rank these hands. I already got a function that compar
7 matches
Mail list logo