[R] Extracting wind direction and wind speed from wind rose plot

2024-10-30 Thread javad bayat
_Speed that the data extracted from the plot by analyzing it. Is there any library to do this? or any function to write for this purpose? I would be more than happy if you please help me to do this. Sincerely -- Best Regards Javad Bayat M.Sc. Environ

Re: [R] Problem with converting grib file to excel

2024-09-26 Thread javad bayat
ut reading GRIB files, I work with them all the time. > But if you don’t make the file available, or point me to where I can > download it, there is not much I can do. > > Thanks, > > -Roy > > On Sep 25, 2024, at 9:41 PM, javad bayat wrote: > > Dear all; > Ma

Re: [R] Problem with converting grib file to excel

2024-09-25 Thread javad bayat
gt; > > On Tue, 24 Sep 2024, 21:26 Bert Gunter, wrote: > > > >> You might try posting on r-sig-geo if you don't get a satisfactory > >> response here. I assume there's a lot of expertise there on handling > >> raster-type data. > >> > >> Ch

[R] Problem with converting grib file to excel

2024-09-23 Thread javad bayat
ar(df$valid_time) df$Month <- month(df$valid_time) df$Day <- day(df$valid_time) df$Hour <- hour(df$valid_time) # Select only the desired columns df_selected <- df %>% select(Year, Month, Day, Hour, tcc, t2m, RH) # Save the updated DataFrame to an Excel file write.xlsx(df_selected, excel_

Re: [R] Converting .grib to excel file

2024-06-28 Thread javad bayat
One of the major things about R is that from the very beginnings of S > > it was intended to be used with other tools. We have R communicating > > with Python and Tcl and dear knows what. Getting a specialised tool > > to do its thing is very much part of the R "way". >

Re: [R] Converting .grib to excel file

2024-06-26 Thread javad bayat
t;- extract(raster_data, param_names, df = TRUE) #Error in (function (classes, fdef, mtable) : #unable to find an inherited method for function ‘extract’ for signature ‘"SpatRaster", "character"’ > param_values <- lapply(raster_data, param_names) #Error: std::bad_allo

Re: [R] Converting .grib to excel file

2024-06-25 Thread javad bayat
Dear Bert and Sara; I have searched on the internet and found some way to do this like python. But python is so complicated to me as it needs many steps to be done for reading and converting it. I will try terra package to convert it. On Tue, 25 Jun 2024, 15:15 javad bayat, wrote: > Rich

Re: [R] Converting .grib to excel file

2024-06-25 Thread javad bayat
ep went wrong and how? > > > On Tue, 25 Jun 2024 at 20:33, javad bayat wrote: > > > > Dear all; > > I have downloaded meteorology data from " > > > https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels?tab=form > " > > a

[R] Converting .grib to excel file

2024-06-25 Thread javad bayat
ary(rNOMADS) # Read GRIB data grib_data <- ReadGrib("C:/Users/admin/Downloads/Met.grib") # Convert to a data frame grib_df <- as.data.frame(grib_data) # Write the data frame to a CSV file write.csv(grib_df, file = "output.csv") I would be more than happy if anyone could he

[R] Reminder: Question regarding reservoir volume and water level

2024-04-15 Thread javad bayat
On Wed, Apr 10, 2024 at 11:05 PM javad bayat wrote: > Dear all; > Thank you for your reply. > David has explained an interesting method. > David I have DEM file of the region and I have extracted the xyz data from > that. > Also I can extract bathymetry data as xyz file. >

Re: [R] Question regarding reservoir volume and water level

2024-04-10 Thread javad bayat
mpossible to > answer without knowledge of the reservoir shape. E.g. in a cylindrical > reservoir halving the water level also halves the volume, but in a conical > reservoir, halving the level leaves only 1/8 of the volume. > > > > -pd > > > > > > > >&g

Re: [R] Question regarding reservoir volume and water level

2024-04-07 Thread javad bayat
he side and pour in if the level lowers or can > be > used to escape if the level rises. > > > -Original Message- > From: R-help On Behalf Of Sorkin, John > Sent: Sunday, April 7, 2024 3:08 PM > To: Rui Barradas ; javad bayat >; > R-help > Subject: Re: [

[R] Question regarding reservoir volume and water level

2024-04-07 Thread javad bayat
level if the volume rises to 1250 m? or what would be the water level if the volume doubled (14,000,000 m3)? Is there any way to write codes to do this in R? I would be more than happy if anyone could help me. Sincerely -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative

Re: [R] Problem when trying to install packages

2024-03-16 Thread javad bayat
site to proceed. > Just a guess obviously. > > Bert > > On Sat, Mar 16, 2024, 05:09 javad bayat wrote: > >> Dear Rui; >> Many thanks for your reply. I have installed Rtools (rtools43-5958-5975) >> on >> my PC and I have R version 4.3.3 and 4.3.2 to i

Re: [R] Problem when trying to install packages

2024-03-15 Thread javad bayat
gt; MB > trying URL ' https://cran.rstudio.com/src/contrib/lubridate_1.9.3.tar.gz'Content > type 'application/x-gzip' length 428043 bytes (418 KB)downloaded 418 > KB > trying URL ' https://cran.rstudio.com/src/contrib/mapproj_1.2.11.tar.gz'Content >

[R] Linear model and approx function

2023-12-09 Thread javad bayat
Dear all; I have a dataframe with several columns. The columns are the elevation, volume and the area of the cells (which were placed inside a polygon). I have extracted them from DEM raster to calculate the volume under polygon and the elevation for a specific volume of the reservoir. > head(x6

Re: [R] Volume of polygon

2023-12-05 Thread javad bayat
> more sensible approximations thereto. > > Cheers, > Bert > > On Tue, Dec 5, 2023, 20:13 javad bayat wrote: > >> Dear all; >> I am trying to calculate the volume of a polygon shapefile according to a >> DEM raster. I have provided some codes at the end of this e

[R] Volume of polygon

2023-12-05 Thread javad bayat
<- exact_extract(r, p, coverage_area = TRUE) x1 = as.data.frame(x[1]) head(x1) x1 = na.omit(x1) x1$Height = max(x1[,1]) - x1[,1] x1$Vol = x1[,2] * x1[,3] sum(x1$Vol) " -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.co

[R] Calculating volume under polygons

2023-11-20 Thread javad bayat
#### -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] __ R-help@r-project.org mailin

Re: [R] Problem with filling dataframe's column

2023-06-13 Thread javad bayat
ved, > grep returns the positions of the matches. See an example below. > > > v <- c("abc", "bcd", "def") > > v > [1] "abc" "bcd" "def" > > grep("cd",v) > [1] 2 > > w <- v[-grep("cd&q

Re: [R] Problem with filling dataframe's column

2023-06-12 Thread javad bayat
3 rows of the dataframe. I do not know the reason. On Mon, Jun 12, 2023 at 5:16 PM Rui Barradas wrote: > Às 23:13 de 12/06/2023, javad bayat escreveu: > > Dear Rui; > > Many thanks for the email. I tried your codes and found that the length > of > > the "Value

Re: [R] Problem with filling dataframe's column

2023-06-11 Thread javad bayat
re any other way to expand the code in order to consider all of the levels simultaneously? Like the below code: data2$LU[which(data2$Layer == c("Level 1","Level 2", "Level 3", ...))] <- c("Park", "Agri", "GS", ...) Sincerely O

[R] Problem with filling dataframe's column

2023-06-11 Thread javad bayat
ayer)){ if (data2$Layer == "Level 12") { data2$LU == "Park" } } -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] ___

Re: [R] Write text file in Fortran format

2022-09-22 Thread javad bayat
the file? > > Rui Barradas > > Às 06:44 de 22/09/2022, javad bayat escreveu: > > Dear all; Many thanks for your useful comments and codes. > > I tried both Rui's and Jim's codes. > > Jim's codes gave an error as below: > > "Error in substr(inputlin

Re: [R] Write text file in Fortran format

2022-09-21 Thread javad bayat
t gave me this error: " > df1 <- read.table(text = txt_table) Error in read.table(text = txt_table) : no lines available in input " The codes before the "df1 <- read.table(text = txt_table)" were run correctly. Sincerely On Thu, Sep 22, 2022 at 6:58 AM javad bayat wrote:

Re: [R] Write text file in Fortran format

2022-09-21 Thread javad bayat
translation of ... written 3 times > > We can simplify 1X,F13.5 to F14.5 > Here's the sprintf() equivalent of the Fortran format, > except you'll need to change the dots to spaces. > > "%14.5f%14.5f%14.5f%9.2f%9.2f%9.2f...%5s..%8s..%5s.%8s%10d\n > > On Th

Re: [R] Write text file in Fortran format

2022-09-21 Thread javad bayat
Dear Rasmus; I have no knowledge of the FORTRAN language. The text file that has been attached is a model's output file and I know that the format is in FORTRAN. I want to write a text file exactly similar to the attached text file using R programming. The steps below explain my goal: 1- Read the t

[R] Getting minimum value of a column according a factor column of a dataframe

2022-08-24 Thread javad bayat
but it did not give me what I wanted. > x[which(x$Q == min(x$Q)),] Sincerely -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] __ R-help@r-project.org mailin

[R] High error made by Neural network in R

2022-07-30 Thread javad bayat
0 1layhid2.to.u 8.355812e+00 1layhid3.to.u 9.095662e+00 1layhid4.to.u 8.024959e+00 > results_met <- neuralnet::compute(n2, test_met[,1:3]) " I am confused why the error is so high ( 3.069188e+07). Is it a problem regarding my codes? Is the prediction made by this neur

[R] Satelit Image

2021-07-26 Thread javad bayat
Dear all; I want to extrac special wavelength of landsat8 image, 470nm and 570nm. Is there any way to do this? Sincerely -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted

[R] Fwd: Create new polygon from a polygon

2021-04-21 Thread javad bayat
-- Forwarded message - From: javad bayat Date: Fri, Apr 16, 2021 at 9:00 AM Subject: Create new polygon from a polygon To: Dear all; I have a polygon and I want to divide it into 2 new polygons. The first one must be 54 percent of the initial polygon area and the remaining area

[R] Increasing the resolution of a raster

2021-03-23 Thread javad bayat
bayat3 <- raster(bayat) bayat3 <- interpolate(bayat3, tps) bayat3 <- mask(bayat3, bayat) plot(bayat3) Sincerely -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] ___

[R] Split Dataframe into several

2021-03-08 Thread javad bayat
cannot use the data. Please help me to fix this problem. Sincerely -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To

Re: [R] Read Unicode text (*.txt)

2019-07-01 Thread javad bayat
d result. > > > > [[alternative HTML version deleted]] > > > >__ > >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > >https://stat.ethz.ch/mailman/listinfo/r-help > >PLEASE do read the posti

[R] Read Unicode text (*.txt)

2019-07-01 Thread javad bayat
ut > attach(d4) > dim(d4) [1] 1814394 1 " I opened the csv file in excel and I tried to make a new csv (delimited) file. I dont know why in the "save as type" box Unicode text (*.txt) is written. Why the format is txt while the file extension is .CSV? Please help me to r

[R] Problem with combining 2 data frame

2019-02-15 Thread javad bayat
ifelse(df1$x1 == df2$x1, df1$x2==df2$x2, "NA")} f(df1,df2) Error in Ops.factor(df1$x1, df2$x1) : level sets of factors are different Is there anyone to help me to solve this problem? Sincerely. -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternativ

Re: [R] Extract the coordinates of a Polylines

2019-01-31 Thread javad bayat
58.5 0 LWPolyline C-TOPO-MAJR 9 Continuous1258.5 0 LWPolyline C-TOPO-MAJR 9 Continuous1258.5 0 LWPolyline C-TOPO-MAJR 9 Continuous1258.5 How can I do this. Sincerely. On Sat, Jan 26, 2019 at 9:37 AM javad bayat wrote: > Dear R users; > I am trying to ext

[R] Extract the coordinates of a Polylines

2019-01-27 Thread javad bayat
variables? line = readOGR("E://Topo.shp") Z = line@data$Elevation Sincerely. -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] __ R-help@r-p

[R] Deleting a specific value in a column of a data frame

2018-06-23 Thread javad bayat
do nothing. Sincerely. -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.

[R] Calculating angle of a polyline

2018-01-30 Thread javad bayat
Dear R users I am trying to find a formula to calculate the angle of a polyline. Is there a way to do this? Many thanks. -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted

[R] how to label station names on point

2017-11-12 Thread Javad Bayat via R-help
I have a shapefile point and I plot it over my polygon. Is it possible to label station names over points?Sincerely. S_Point = readOGR(".","point")plot(S_Point,add=TRUE,col="black",pch=20,cex=2) [[alternative HTML version deleted]] __ R-help

[R] Convert poly line to polygon in R

2017-11-12 Thread Javad Bayat via R-help
I have a shape file as poly line and I want to convert it to polygon.Is it possible to do that in R?lake <-readShapeLines("./lake_main_utm.shp")proj4string(lake) <- CRS("+proj=utm +zone=39 +datum=WGS84") Sincerely. [[alternative HTML version deleted]] _

Re: [R] How to get bathymetry data using R

2016-06-11 Thread javad bayat
this I much prefer netcdf files. > > If you have any questions at all about either the “rerddap” package > (developed by the wonderful people at ROpenSci) or about our ERDDAP > service, don’t hesitate to ask. > > -Roy > > > On Jun 11, 2016, at 12:30 AM, Michael Sumn

[R] How to get bathymetry data using R

2016-06-10 Thread javad bayat
Dear R users; I am searching for a package to extract bathymetry data from topography map to produce the control file for CE-Qual-w2 model. Is there anyone to know how to do it? many thanks. -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com

[R] Prediction data gaps by "neuralnet" package

2015-11-19 Thread javad bayat
colorofil.A 1 Sp NA 2 Sp 10 > net.sqrt <- neuralnet(colorofil.A~Season,ss1, hidden=10, threshold=0.01) print(net.sqrt) -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat...@yahoo.com [[

[R] prediction with neural network

2015-11-13 Thread javad bayat
Hi all; I am working with a data set, pH of a lake water, and there is some gap in my data. I it possible to predict these gaps by neural network? If so please help to use the right code. Many thanks. -- Best Regards Javad Bayat M.Sc. Environment Engineering Alternative Mail: bayat

[R] correlation matricies: getting p-values?

2015-06-28 Thread JAVAD BAYAT
Dear Bill Venables; Hi, I am using "cor" command to get the correlation coefficients for my data frame. I found somthing in the following site: " https://stat.ethz.ch/pipermail/r-help/2000-January/009758.html"; . I used your function

[R] CCA package

2015-06-25 Thread javad bayat
Dear R users; I am using CCA package to calculate the correlation between two data set. Every time that I run my codes, I get the following error; "the leading minor of order 5 is not positive definite". Please help me to fix it. Many thanks. -- Best Regards Javad Bayat M.Sc. E

Re: [R] Neural Network

2015-01-23 Thread javad bayat via R-help
question you want to  answer.  Given your temporal data, you may want to look in  to mixed effects models (e.g nlme, lme4) as another  potential approach.  Regards,  On Tue, Jan 20, 2015 at  11:35 PM, javad bayat via R-help  wrote:  Dear  all;  I am the new user of R. I want to s

Re: [R] Neural Network

2015-01-23 Thread javad bayat via R-help
ok in  to mixed effects models (e.g nlme, lme4) as another  potential approach.  Regards,  On Tue, Jan 20, 2015 at  11:35 PM, javad bayat via R-help  wrote:  Dear  all;  I am the new user of R. I want to simulation or prediction  the Eutrophication of a lake. I have week

[R] Neural Network

2015-01-20 Thread javad bayat via R-help
Dear all; I am the new user of R. I want to simulation or prediction the Eutrophication of a lake. I have weekly data(almost for two years) for Total phosphorus, Total N, pH, Chlorophyll a, Alkalinity, Silica. Can I predict the Eutrophication by Neural Network in R? How can I simulation the Eutro

[R] N.network help

2014-11-19 Thread Javad Bayat
ctions2)## plot the results together with original datalibrary(lattice)library(latticeExtra)xyplot(pH ~ Day|factor(station.2), data = bayat2, type = "b", layout = c(3,2), xlim = c(0:1000))+xyplot(pH ~ Day|factor(station.2), data = predictions2, type = "b", layout = c(4,2), col =

[R] spplot help

2014-07-20 Thread javad bayat
Dear all I am using spplot command to plot my raster. I make it but there is two problems with me. 1- I want to have no border or greater border around the raster 2- I want to insert a legend with a header aside from its legend. please help me. thanks in advance. -- Best Regards Javad Bayat

[R] Biplot interpretation

2014-06-24 Thread javad bayat
Dear all; I did biplot in R. How can I interpret them in order that i can create two or more groups in each biplot. I wanna determine the variables that have the same origin. please help me. many thanks. -- Best Regards Javad Bayat M.Sc. Environment Engineering Shahid Beheshti (National

[R] Logistic Regression

2014-06-14 Thread javad bayat
priate for my data. Many thanks for your helps. -- Best Regards Javad Bayat M.Sc. Environment Engineering Shahid Beheshti (National) University (SBU) Alternative Mail: bayat...@yahoo.com [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] help

2014-01-07 Thread javad bayat
6 21 8.275635963 On Tue, Jan 7, 2014 at 2:12 PM, javad bayat wrote: > Dear Pikal Petr; > thanks for code. > It was usefull. > > > > On Tue, Jan 7, 2014 at 11:30 AM, PIKAL Petr wrote: > >> Hi >> >> >> >> and what is wrong with e.g

Re: [R] help

2014-01-06 Thread javad bayat
used without retyping. > > Redarding neural network, did you try e.g. nnet or neuralnet package. > > Petr > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > > project.org] On Behalf Of javad bayat > > Sent: Monday, Ja

Re: [R] help

2014-01-06 Thread javad bayat
Dear Saha thank you to reminding me. Here is the text file. On Mon, Jan 6, 2014 at 10:33 AM, Koushik Saha wrote: > please don't send images . paste your data in a text file with .text > extension and attach it > > > On Mon, Jan 6, 2014 at 12:06 PM, javad bayat wrote: &g

Re: [R] help

2014-01-05 Thread javad bayat
Dear all; many thanks for your answers. Hear is my data (not all row: the station was 8 station at 20 month) which I forward it as image. I hope some one can help me to do Neural network for prediction of next month. many thanks. all bests. -- Best Regards Javad Bayat M.Sc. Environment

[R] help

2014-01-05 Thread javad bayat
the case. many thanks. all bests. -- Best Regards Javad Bayat M.Sc. Environment Engineering Shahid Beheshti (National) University (SBU) Alternative Mail: bayat...@yahoo.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] R function

2013-07-28 Thread javad bayat
Dear R users; I am MSc student and I want to write my own function, but it cant be completed. please help me for solve it. here is my code: pah1$P = (pah1$Fluoranthene/pah1$Pyrene) T = function(x){ for (i in 1:length(pah1$P)) if (i >= 1) print("Combustion") if (i < 1) print("Petroleum") } T(pah1$P

[R] surface plot

2013-07-28 Thread javad bayat
Dear R users; I have a question about surface plot that show me spatial variability of parameter. I have a data frame with 6 variables and X and Y for coordinate system. X Y pH ..... ... so I want to create a surface plot for my data. please help me. many thanks.

[R] saving to docx

2012-10-19 Thread javad bayat
hi all, how can i saving R output to docx or Jpeg format? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-gu