[R] Just for your (a|be)musement.

2024-04-13 Thread Richard O'Keefe
I recently had the chance to read a book explaining how to use ChatGPT with a certain programming language. (I'm not going to describe the book any more than that because I don't want to embarrass whoever wrote it.) They have appendix material showing three queries to ChatGPT and the answers.

Re: [R] any and all

2024-04-13 Thread Lennart Kasserra
Hi Avi, As Dénes Tóth has rightly diagnosed, you are building an "all or nothing" filter. However, you do not need to explicitly spell out all columns that you want to filter for; the "tidy" way would be to use a helper function like `if_all()` or `if_any()`. Consider this example (I hope I

Re: [R] any and all

2024-04-13 Thread avi.e.gross
Yes, Lennart, I have been looking at doing something like you say by using the vectorized ways the tidyverse is now offering. For my application, if the naming was consistent, an approach like yours is good, albeit has to be typed carefully. When I cannot control the names but have to lump

Re: [R] Just for your (a|be)musement.

2024-04-13 Thread avi.e.gross
Richard, The code you show is correct and it does not include where you say ChatGTP explained it was 33/26 rather than the correct 42/216. I gather it have the proper fraction for the other two scenarios. So what would cause such a localized error? The method chosen is to try all possible