[R] Ps: Reinterpret data without saving it to a file 1st? Check for integer stopping at 1st decimal?

2024-07-14 Thread DynV Montrealer
The answer: https://statisticsglobe.com/change-classes-data-frame-columns-automatically-r On Sun, Jul 14, 2024 at 3:16 AM DynV Montrealer wrote: > A small number of columns in the data I need to work with are strings, the > rest numbers. I'm using read_excel() from the readxl pac

[R] Reinterpret data without saving it to a file 1st? Check for integer stopping at 1st decimal?

2024-07-14 Thread DynV Montrealer
A small number of columns in the data I need to work with are strings, the rest numbers. I'm using read_excel() from the readxl package to get the data ; right after it, the string columns are of type chr and the rest num. I'm tasked with finding out which columns are integers. From an advice, I t

[R] plot(aov, which=1) with different labels?

2024-06-19 Thread DynV Montrealer
I need to do a non-English report including the red line from plot(aov, which=1), which I don't know how to reproduce. I'm thinking that if I replace the labels that it would be good (so no English remains). What I have so far is almost what I need, the only thing that needs to change is what's rig

[R] Least error-prone reading of Excel files?

2024-05-16 Thread DynV Montrealer
I'm tasked to read a table from an excel file and it doesn't mention which method to use. I went back some lessons ago and the 5 years old lesson mentioned to pick a package using the highest score the way of the attached (screenshot). Since there's no requirement of a method to read Excel files, I

Re: [R] Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?

2024-05-03 Thread DynV Montrealer
> > > ifelse(mat_bools, mat_letters, "") > [,1] [,2] > [1,] "" "B" > [2,] "C" "" > > ifelse(mat_bools, mat_letters, NA) > [,1] [,2] > [1,] NA "B" > [2,] "C" NA > > Marc > > > &g

[R] Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?

2024-05-03 Thread DynV Montrealer
Is there a way to get a copy of a matrix only for TRUE entries of a matching size boolean matrix? For *example*: > mat_letters <- matrix(data=c('A', 'B', 'C', 'D'), ncol=2, byrow=TRUE) > mat_letters [,1] [,2] [1,] "A" "B" [2,] "C" "D" > mat_bools <- matrix(data=c(FALSE, TRUE, TRUE, FALSE), n