Displaying 20 results from an estimated 1000 matches similar to: "ggarrange & legend"
2024 Feb 05
2
ggarrange & legend
Dear John Kane
Dear R community
Here my working example
1. Example that is working with legend=?top?. However, as mentioned, the legend is in the middle of the top axis.
mylist<-list(p1, p2)
dev.new(width=28, height=18)
fig1<- ggarrange(plotlist=mylist, common.legend = TRUE, legend="top", labels = c("(A)", "(B)"), font.label = list(size = 18, color =
2024 Feb 05
1
ggarrange & legend
Could you supply us with a MWE (minimal working example)of what you have so
far?
Thanks.
On Mon, 5 Feb 2024 at 05:00, SIBYLLE ST?CKLI via R-help <
r-help at r-project.org> wrote:
> Dear R community
>
> It is possible to adjust the legend in combined ggplots using ggarrange
> with
> be positions top, bottom, left and right.
> My question: Is there a function to change the
2024 Feb 05
1
ggarrange & legend
I'm sorry but that is not a working example.
A working example needs to create the plots being used.
For example, stealing some code from
https://rpkgs.datanovia.com/ggpubr/reference/ggarrange.html
#=================================================================
data <https://rdrr.io/r/utils/data.html>("ToothGrowth")df <-
ToothGrowthdf$dose <- as.factor
2024 Apr 18
2
Import multiple tif raster
Dear community
Dear Ivan
Thanks a lot. The code works now. Solution: direct and full path to the .tif files.
I confused back and forward slash
#first import all files in a single folder as a list
rastlist <- list.files(path = "C:/Users/Sibylle St?ckli/Desktop/NCCS_Impacts_Lot2_2022/InVEST/Species_Input/valpar_bee_presence", pattern='.tif$', all.files= T, full.names= T)
At
2024 Apr 18
1
Import multiple tif raster
Dear Ivan
Thanks a lot.
I tried now to provide the full path. However probably the "?" in the path produces the error, would that be possible?
> #first import all files in a single folder as a list
> rastlist <- list.files(path = "C:\Users\Sibylle St?ckli\Desktop\NCCS_Impacts_Lot2_2022\InVEST\Species_Input\valpar_bee_presence", pattern='.tif$', all.files=
2024 Aug 16
2
allequal diff
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 is.na() in getValues(). So I need to call getValues a second time? I suppose you mean to first
2024 Apr 18
1
Import multiple tif raster
? Thu, 18 Apr 2024 11:08:33 +0200
SIBYLLE ST?CKLI via R-help <r-help at r-project.org> ?????:
> > #to check the index numbers of all imported raster list elements
> > allrasters
> list()
> >
> > #call single raster element
> > allrasters[[1]]
> Error in allrasters[[1]] : subscript out of bounds
`allrasters` is an empty list, so it doesn't have a
2024 Aug 18
2
allequal diff
Dear Ivan
Thanks a lot for this very nice example.
Is it true that all.equal just compares y values?
Based on this help here I think so and the value I got is the difference for the y-values.
https://www.statology.org/all-equal-function-r/
However, here I see x and y testing?
https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/all.equal
I am actually interested in the x values
2024 Aug 16
1
allequal diff
? Fri, 16 Aug 2024 07:19:38 +0200
SIBYLLE ST?CKLI via R-help <r-help at r-project.org> ?????:
> 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, combine the two masks using the |
operator
2010 Oct 27
1
Fwd: as.list
-------- Original-Nachricht --------
Datum: Wed, 27 Oct 2010 15:03:48 +0200
Von: "Sibylle St?ckli" <sibylle.stoeckli at gmx.ch>
An: Rhelp <r-help at r-project.org>
Betreff: as.list
Dear R-users
sorry, here Rcode included (attachment has been removed)
I would like to read a txt file as list, to select rows and columns, and to create barplots.
(1) selection of parameter
2018 Jan 09
3
barplot_add=TRUE
Dear R users
aim
Barplot of insect trap catches (y variable trapcatch) at one specific station (variable FiBL_Hecke) from week 1-52 ( x variable week).
It works well using the function tapply (sum trapcatch per week, males and females not separated), however, I intend to separate the y variable trapcatch in males and females (variable m_w: m and w)
problem
I used the function "add" to
2006 Mar 10
2
Plot.date and legends
Hi:
I'm trying to plot dates on the x-axis of a code, but the legend is not being
displayed. I receive the following error:
Error in match.arg(x, c("bottomright", "bottom", "bottomleft", "left", :
'arg' should be one of bottomright, bottom, bottomleft, left,
topleft, top, topright, right, center
In addition: Warning message:
longer
2024 Aug 18
2
allequal diff
"Is it true that all.equal just compares y values?"
The following may be a bit more than you may have wanted, but I hope
it is nevertheless useful.
The first place you should go to for questions like this is the Help
system, not here, i.e.
?all.equal
When you do this, you will find that all.equal() is a so-called S3
generic function, which, among other things, means that it works
2010 Sep 23
2
dnorm
Dear R-users
Idea:
Plot a dnorm line using specific mean/sd to complete a histogram (skewed). xs:range of y-values, ys: dnorm function
Problem:
I expected to multiply the ys function with the sample size (n=250-300). I was wondering about a factor between 12'000 and 30'000 to match the size of the dnorm line with the specific histogram.
Thanks
Sibylle
hist(Biotree[Ld,]$Height2008,
2024 Aug 16
2
boxplot notch
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 has length zero
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
In
2024 Nov 06
3
Using multiple dat files
Dear community
To import multiple .dat weather files I am using list.files().
I intend to use the R package ?ClimInd? to calculate different agroclimatic indicators.
Question: Is there another solution to import multiple .dat files so that I can select elements from the list, e.g. one specific weather file (example AAR_DailyWeather)?
# Import multiple .dat files weather data
filelist <-
2024 Nov 06
1
Using multiple dat files
"It seems therefore that there is no other way than read in individually >
100 weather tables using read.tables., right? Using file.choose() doesn't
change the work."
Yes. With that many files, file.choose() does not make sense. However, I
still do not understand what is the problem with using lapply() on the
character vector of file names with read.table() as you did in your
2024 Jul 18
1
ggplot two-factor legend
If I follow your question, you want redundant aesthetics. Ggplot normally notices correlated aesthetic mapping variables and merges the legends, so the most likely answer is that your data are not fully correlated in all rows. I have also seen this where data are drawn from different dataframes for different layers since it is hard to merge factors, but I don't see that here.
You are using
2024 Feb 26
1
igraph_vertex
? Mon, 26 Feb 2024 09:02:56 +0100
SIBYLLE ST?CKLI via R-help <r-help at r-project.org> ?????:
> In the following code, which loads the tiff file, I get the following
> error
This warning is definitely worth investigating, but it shouldn't
interrupt your code. Does the figure come out wrong after you see this
warning?
> In doTryCatch(return(expr), name, parentenv, handler) :
2024 Aug 22
1
paired raster boxplots
? Thu, 22 Aug 2024 08:46:03 +0200
SIBYLLE ST?CKLI via R-help <r-help at r-project.org> ?????:
> rr2s <- stack(r, r2,s)
> > names(rs) <- c('r', 's', 'r2')
>
> Error in `names<-`(`*tmp*`, value = c("r", "s", "r2")) :
>
> incorrect number of layer names
The error must be happening because the variable