Re: [R] if-else that returns vector

2023-10-12 Thread Richard O'Keefe
?ifelse 'ifelse' returns a value with the same shape as 'test' which is filled with elements selected from either 'yes' or 'no' depending on whether the element of 'test' is 'TRUE' or 'FALSE'. This is actually rather startling, because elsewhere in the S (R) language, operands are

Re: [R] Problem with compatible library versions

2023-10-12 Thread Richard O'Keefe
The purpose of 'groundhog' is to support reproducible research. As Uwe Ligges pointed out, there are practical limits to that. Since I am typing this on a 10-year-old machine, it's clearly feasible in *some* instances, but as an illustration of Uwe's point, Ubuntu still supports 32-bit

Re: [R] Linear discriminant analysis

2023-10-12 Thread Uwe Ligges
On 12.10.2023 16:25, Fernando Archuby wrote: Hi. I have successfully performed the discriminant analysis with the lda function, I can classify new individuals with the predict function, but I cannot figure out how the lda results translate into the classification decision. That is, I don't

Re: [R] if-else that returns vector

2023-10-12 Thread Rui Barradas
Às 21:22 de 12/10/2023, Christofer Bogaso escreveu: Hi, Following expression returns only the first element ifelse(T, c(1,2,3), c(5,6)) However I am looking for some one-liner expression like above which will return the entire vector. Is there any way to achieve this?

Re: [R] if-else that returns vector

2023-10-12 Thread Jeff Newmiller via R-help
What a strange question... ifelse returns a vector (all data in R is vectors... some have length 1, but length zero is also possible, as are longer vectors) that is exactly as long as the logical vector that you give it, filled with elements from the respective positions in the vectors supplied

Re: [R] if-else that returns vector

2023-10-12 Thread Ben Bolker
how about if(T) c(1,2,3) else c(5,6) ? On 2023-10-12 4:22 p.m., Christofer Bogaso wrote: Hi, Following expression returns only the first element ifelse(T, c(1,2,3), c(5,6)) However I am looking for some one-liner expression like above which will return the entire vector. Is there any way

[R] if-else that returns vector

2023-10-12 Thread Christofer Bogaso
Hi, Following expression returns only the first element ifelse(T, c(1,2,3), c(5,6)) However I am looking for some one-liner expression like above which will return the entire vector. Is there any way to achieve this? __ R-help@r-project.org mailing

Re: [R] Linear discriminant analysis

2023-10-12 Thread Ben Bolker
It's possible that neither of these will help, but (1) you can look at the source code of the predict method (MASS:::predict.lda) (2) you can look at the source reference ("Modern Applied Statistics in S", Venables and Ripley) to see if it gives more information (although it might not);

[R] Linear discriminant analysis

2023-10-12 Thread Fernando Archuby
Hi. I have successfully performed the discriminant analysis with the lda function, I can classify new individuals with the predict function, but I cannot figure out how the lda results translate into the classification decision. That is, I don't realize how the classification equation for new

Re: [ESS] why a release from time to time would be nice

2023-10-12 Thread Tyler Smith via ESS-help
Hi Stephen, yasnippet allows you to insert modifiable yaml templates. You can define 'fields' that you want to modify, along with straight text that will be inserted verbatim. In my case, I enter the string 'yaml', hit the tab key, and the template is inserted. The cursor starts in the title

Re: [ESS] why a release from time to time would be nice

2023-10-12 Thread Stephen Bond via ESS-help
Tyler, Happy you are lending a hand. I alternate between notebook and plain htmil output. this is my typical: --- title: "Title" author: "Author" date: "2023-10-08" output: # html_document: # df_print: kable # mathjax: C:/emacs/MathJax.js html_notebook: df_print: kable

[R-es] Análisis discriminante lineal, interpretación

2023-10-12 Thread Fernando Archuby
Buenos días/tardes. He realizado el análisis discriminante exitosamente con la función lda, puedo clasificar nuevos individuos con la función predict, pero no logro darme cuenta cómo los resultados de lda se traducen en la decisión de la clasificación. Es decir, no me doy cuenta cómo es que del

Re: [R] Text showing when R is launched

2023-10-12 Thread George Loftus
Hi, Thankyou for your response