Re: [R] allequal diff

2024-08-16 Thread Ivan Krylov via R-help
В Fri, 16 Aug 2024 07:19:38 +0200 SIBYLLE STÖCKLI via R-help пишет: > Is it possible to consider na.rm=TRUE? > > all.equal(getValues(r1), getValues(r2_resampled), tolerance = 0) > > [1] "'is.NA' value mismatch: 9544032 in current 66532795 in target" Use is.na() on getValues() outputs, combin

Re: [R] allequal diff

2024-08-16 Thread SIBYLLE STÖCKLI via R-help
Many thanks Ivan Use is.na() on getValues() outputs, combine the two masks using the | operator to get a mask of values that are missing in either raster, then negate the mask to choose the non-missing values: all.equal(getValues(r1)[!mask], getValues(r2)[!mask]) --> what do you mean by use i

Re: [R] allequal diff

2024-08-16 Thread Ivan Krylov via R-help
В Fri, 16 Aug 2024 10:35:35 +0200 пишет: > what do you mean by use is.na() in getValues(). So I need to call > getValues a second time? Not necessarily, but it's one of the options. I was thinking along the lines of: values1 <- getValues(r1) mask1 <- is.na(values1) # Do the same for r2 # Combin

Re: [R] allequal diff

2024-08-16 Thread SIBYLLE STÖCKLI via R-help
Here my idea including the error: > m1=r1[r1="NA",] > m2=r2_resampled[r2_resampled="NA",] > > > all.equal(getValues(r1)[!m1], getValues(r2_resampled)[!m2]) [1] "Numeric: lengths (80706867, 65806339) differ" -Original Message- From: R-help On Behalf Of SIBYLLE STÖCKLI via R-

Re: [R] allequal diff

2024-08-16 Thread SIBYLLE STÖCKLI via R-help
Cool thanks # values and mask r1 r1 <- getValues(r1) mask1 <- is.na(r1) # Do the same for r2 r2 <- getValues(r2_resampled) mask2 <- is.na(r2) # Combine the masks all.equal(r1[!(mask1 & mask2)], r2[!(mask1 & mask2)]) output > all.equal(r1[!(mask1 & mask2)], r2[!(mask1 & mask2)]) [1] "'is.NA' val

Re: [R] allequal diff

2024-08-16 Thread Ivan Krylov via R-help
В Fri, 16 Aug 2024 11:32:58 +0200 пишет: > # values and mask r1 > r1 <- getValues(r1) > mask1 <- is.na(r1) > # Do the same for r2 > r2 <- getValues(r2_resampled) > mask2 <- is.na(r2) > > # Combine the masks > all.equal(r1[!(mask1 & mask2)], r2[!(mask1 & mask2)]) Let's consider a more tangible e

[R] Is there some place where I can check a changelog / NEWS for the grid package?

2024-08-16 Thread Iago Giné Vázquez
Hi all, On one hand, I wanted to ask if there is some place where I can check a changelog / NEWS for the grid package, as it is not on CRAN. And in that case, where can I find it? On the other hand, I wanted to ask you for tutorials to start understanding the grid package or what other recomme

Re: [R] Is there some place where I can check a changelog / NEWS for the grid package?

2024-08-16 Thread Uwe Ligges
On 16.08.2024 13:46, Iago Giné Vázquez wrote: Hi all, On one hand, I wanted to ask if there is some place where I can check a changelog / NEWS for the grid package, as it is not on CRAN. And in that case, where can I find it? Grid is part of R, hence you can look at R's NEWS, e.g. at

[R] boxplot notch

2024-08-16 Thread SIBYLLE STÖCKLI via R-help
Dear community I tried the following code using geom_boxplot() and notch=TRUE. Does anyone know if the command �notch=TRUE� is at the wrong place in my special code construct? Without notch=TRUE the code provides the planned ggplot. Kind regards Sibylle Code: MS1<- MS %>% filte

Re: [R] boxplot notch

2024-08-16 Thread Ben Bolker
I don't see anything obviously wrong here. There may be something subtle, but we probably won't be able to help without a reproducible example ... On 2024-08-16 9:24 a.m., SIBYLLE STÖCKLI via R-help wrote: Dear community I tried the following code using geom_boxplot() and notch=TRUE. D

Re: [R] boxplot notch

2024-08-16 Thread SIBYLLE STÖCKLI via R-help
Thanks Ben, Here the reproducible example. It works without notch=TRUE, but provides an error with notch=TURE Error in `geom_boxplot()`: ! Problem while converting geom to grob. ℹ Error occurred in the 1st layer. Caused by error in `ans[ypos] <- rep(yes, length.out = len)[ypos]`: ! replacement ha

Re: [R] boxplot notch

2024-08-16 Thread Bert Gunter
Probably should be: rep("yes", length.out = len)[ypos] as yes is probably a nonexistent variable. But I didn't examine your code in detail, so just ignore if I'm wrong. -- Bert On Fri, Aug 16, 2024 at 8:51 AM SIBYLLE STÖCKLI via R-help wrote: > > Thanks Ben, > > Here the reproducible example.

Re: [R] boxplot notch

2024-08-16 Thread Chris Evans via R-help
That's not really a reprex Sibylle.  I did try to use it to see if I could work out what you were trying to do and help but there is so much in there that I suspect is distraction from the notch issue and its error message. Please can you give us something stripped of all unecessary things and

Re: [R] boxplot notch

2024-08-16 Thread CALUM POLWART
Unless I'm missing the point, you are sending the summary data MS1s to the plot. Is that not a VERY unusual way to do it. Let box plot do the summary? Otherwise what do you want the notches to show? On Fri, 16 Aug 2024, 17:21 Chris Evans via R-help, wrote: > That's not really a reprex Sibylle.