Displaying 20 results from an estimated 4000 matches similar to: "Using multiple dat files"
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 07
0
Using multiple dat files
?s 18:59 de 06/11/2024, Sibylle St?ckli escreveu:
> Dear Rui
> Dear Bert
> Many thanks
> Solution
> filelist <- list.files(path = "O:/Data-Work/2.../Daten_RA-MeteoCH_1990-2021",
> pattern='*.dat', all.files= T, full.names= T)
> AAR<-read.table(filelist[1])
> It seems therefore that there is no other way than read in individually > 100
> weather
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 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
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 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 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 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 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
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 Aug 18
1
allequal diff
?? The OP's original problem is that the all.equal method for raster
objects (raster:::all.equal.raster), which is a wrapper around the
compareRaster() function, compares a bunch of different properties of
rasters (extent, resolution, values, etc.) and only returns a single
overall logical (TRUE/FALSE) value. OP wanted to see the magnitude of
the difference (as you could get for more
2024 Aug 18
1
allequal diff
Ah...I see.
Perhaps, then, the maintainer should be contacted, as the desired
functionality seems similar to that provided in other all.equal
methods. I realize that this may often not elicit a (prompt) response.
-- Bert
On Sun, Aug 18, 2024 at 11:50?AM Ben Bolker <bbolker at gmail.com> wrote:
>
> The OP's original problem is that the all.equal method for raster
>
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 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
2023 Nov 24
1
ggplot adjust two y-axis
Hi,
Just find a scaling factor that would make the two sets of data comparable.
Here I divided the second row by 5 and did the same for the second axis.
Charles-?douard
F1 <- as.table(matrix(c(50,11,6,17,16,3,1,2237,611,403,240,280,0,0), 2,7))
barplot(F1, beside = TRUE, col = c("blue", "grey")) axis(2,
at=c(0,10,20,30,40,50,60, labels=c(0,10,20,30,40,50,60))) axis(4, at =
2023 Nov 24
1
ggplot adjust two y-axis
Dear Charles-Edouard
Thanks a lot. Yes indeed barplot sounds excellent.
Unfortunately, the scale of the smaller axis is fixed, even If I am able to
draw to axes. The idea is to expand the scale to the scale to the second
axis for comparison.
F1 <- as.table(matrix(c(50,11,6,17,16,3,1,2237,611,403,240,280,0,0), 2,7))
barplot(F1, beside = TRUE, col = c("blue", "grey"))
2024 Feb 26
1
igraph_vertex
Dear Ivan
Thanks a lot.
I used:
windowsFonts(Helvetica = windowsFont("Helvetica"))
No warning now with Helvetica
Additionally I used "sans", similarly no warning in the first part.
But still not able to open tiff with both versions:
Using "stress" as default layout
> dev.off()
TIFFOpen: figures/AES_network_bymembership.tiff: Cannot open.
RStudioGD
2
2024 Aug 23
1
paired raster boxplots
? Fri, 23 Aug 2024 10:15:55 +0200
<sibylle.stoeckli at gmx.ch> ?????:
> > s<-sf$Unterregio
> > r<-allrasters_pres[[1]]
> >
> >
> > rs <- stack(r, s)
> > names(rs) <- c('r', 's')
> Error in `names<-`(`*tmp*`, value = c("r", "s")) :
> incorrect number of layer names
It looks like at least one
2024 Aug 16
1
allequal diff
? Fri, 16 Aug 2024 10:35:35 +0200
<sibylle.stoeckli at gmx.ch> ?????:
> 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
# Combine the masks
all.equal(values1[!combined_mask],
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