Re: [R] overlay shaded area in base r plot

2023-09-19 Thread ani jaya
col=adjustcolor("yellow", 0.5), >border = NA) > lines(1:20, mean1,lty=1,lwd=2,col="blue") > lines(1:20, mean2,lty=1,lwd=2,col="yellow") > > > On 19-09-2023 09:16, Ivan Krylov wrote: > > В Tue, 19 Sep 2023 13:21:08 +0900 > > ani

Re: [R] overlay shaded area in base r plot

2023-09-19 Thread ani jaya
Thank you very much for the help. Turn out I can use 'density' to differentiate the overlaid area. On Tue, Sep 19, 2023, 16:16 Ivan Krylov wrote: > В Tue, 19 Sep 2023 13:21:08 +0900 > ani jaya пишет: > > > > polygon(c(1:20,20:1),c(mean1[1:20]+sd1[1:20],mean1[20:

[R] overlay shaded area in base r plot

2023-09-18 Thread ani jaya
Dear R-Help, I try to overlay two standard deviations from two means. How to change the overlaid area between two shaded areas into a specific color or maybe a soft color in a plot? > dput(mean1[1:20]) c(122.194495954369, 118.955256282505, 115.540991140893, 113.116216840647, 111.24053267553,

[R] 'apply' for 0 or 1 element member.

2023-08-10 Thread ani jaya
lt;-index[which(index1==i)] C[,,i]<-apply(B[,,dummy],c(1,2), mean,na.rm=T) } The problem is when there is a month that doesnt meet the condition, it will return 0 element. apply(B[,,1],c(1,2), mean,na.rm=T) also produce an error. Any solution and turnaround would be appreciated. T

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
usr") > > after drawing the world map you will see the proportions. > > Jim > > On Fri, Jan 7, 2022 at 7:20 PM ani jaya wrote: > > > > Hi Jim, > > > > Thank you for the alternative. Absolutely will try it. > > Can you explain a bit about "Maps draws

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
> > should give you info how mar looks like before each step and which one is to > blame. > > Jim gave you also some possible workaround. > > Cheers > Petr > > > -Original Message- > > From: ani jaya > > Sent: Friday, January 7, 2022 9:12 AM >

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
n approximately 2x1 plot. Maybe this: > > mappar<-par("usr") > rect(mappar[1],mappar[3],mappar[2],mappar[4]) > > Jim > > On Fri, Jan 7, 2022 at 6:25 PM ani jaya wrote: > > > > Dear R expert, > > > > I try to box a figure using box(). Howe

Re: [R] unexpected (?) behavior of box()

2022-01-07 Thread ani jaya
t;name", lforce="n", ...) > > map function redefines mar so your first par is probably changed during > plotting map and after you define it again box use new mar values. > > Cheers > Petr > > > -Original Message- > > From: R-help On Behalf Of ani j

[R] unexpected (?) behavior of box()

2022-01-06 Thread ani jaya
Dear R expert, I try to box a figure using box(). However it box the default margin, not the specified margin. #working as expected barplot(1:20) box() #working as expected, the box follow the margin par(mar=c(2, 6, 5, 4)) barplot(1:20) box() #not working install.packages("maps") library(maps)

Re: [R] Degree symbol as axis label superscript

2021-11-30 Thread ani jaya
one of my solution : text(x,y,"\u00B0C", cex=1.1, font=2) it will produce "°C" text(x,y,"\u00B3C", cex=1.1, font=2) it will produce "superscript(3)C" so basically change the character after the "\u00B..." will produce the superscript. Best, Ani On Wed, Dec 1, 2021 at 4:05 AM Rich Shepard

Re: [R] field significance test

2021-09-06 Thread ani jaya
and yes I can sleep well now. Thank you, Jim. ne<-rep(0,ne) total<-c(neggg,posss,ne) hist(total) Best, Ani Jaya On Tue, Sep 7, 2021 at 9:38 AM ani jaya wrote: > > Hello Jim, thank you for your response. What I am trying to achieve is > like this: > > #calculate the positiv

Re: [R] field significance test

2021-09-06 Thread ani jaya
not success yet. After that, I want to plot the histogram to see the distribution of significant stations. Any lead is appreciate. Thank you Ani Jaya __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/list

[R] field significance test

2021-09-06 Thread ani jaya
nd negative at the same time. Is there any way to combine positive and negative significant value and plot the histogram? or we can calculate the 0 station first separately? Any lead is really appreciated. Thank you. Ani Jaya __ R-help@r-project.org ma

Re: [R] Occurrence by season

2021-04-22 Thread ani jaya
%%12 + 1 >> >> This changes the month numbering so that Dec becomes 1, Jan becomes 2, etc >> Then your for loop does what you want. >> >> HTH, >> Eric >> >> >> >> >> On Wed, Apr 21, 2021 at 11:09 AM ani jaya wrote: >> >>

[R] Occurrence by season

2021-04-21 Thread ani jaya
Dear r community, I have a data frame that shows the month of occurrence of the maximum value on let say 10 stations in 30 years. I want to make percentages based on seasons (DJF, MAM, JJA, and SON). I can do that by the code below but only when we put season by JFM, AMJ, ...(or 123; 456;

Re: [R] get a month where max value is

2020-12-15 Thread ani jaya
list(mon10$Group.1),which.max) > > Jim > > On Wed, Dec 16, 2020 at 4:55 PM ani jaya wrote: > > > > Dear R-Help, > > > > I have a data frame containing monthly maxima of rainfall in 10 > > locations for 30 year and want to look at a month where an annual > &

[R] get a month where max value is

2020-12-15 Thread ani jaya
Dear R-Help, I have a data frame containing monthly maxima of rainfall in 10 locations for 30 year and want to look at a month where an annual maxima happens. I can get the annual maxima using aggregate. I try to extract the month using the code below.

[R] find local max in moving window

2020-11-13 Thread ani jaya
Dear r list, I try to locate any local max value and location of data that follow 7 moving window condition, meaning that this data is largest and centered in 7 values to the left and 7 values to the right. I can solve it by using for and if function, like below: dput(nordn) c(`1` =

[R] Missing x label in barplot

2020-05-13 Thread ani jaya
Dear R community, I found some missing x label when I saving this plot to tiff file: justsample <- rnorm(n=1095*3,mean=100,sd=10) justsample <- as.data.frame(matrix(justsample,ncol=3)) dd <- seq(from=as.Date("1985-01-01"), to =as.Date("1987-12-31"), by='day') y <- data.frame(Year=substr(dd,1,4),

Re: [R] Mapping of countries

2020-03-31 Thread ani jaya
Maybe simply add: points(station$Lon, station$Lat, col="red", pch=16, label="Your Country") text(station$Lon, station$Lat,"Your Country", col="black", pos=3, cex=1) station$Lon and Lat in your coordinate position. Regards, Ani On Tue, Mar 31, 2020 at 10:58 PM george brida wrote: > >

Re: [R] Subset a data frame with specific date

2020-01-13 Thread ani jaya
> > -- Bert > > > > On Mon, Jan 13, 2020 at 10:56 PM ani jaya wrote: >> >> Dear Jeff and Bert, >> >> Thank you very much for your correction and explanation. >> And yes, I need to study about date format more. >> Sorry for HTML mail, don't realize. >&g

Re: [R] Subset a data frame with specific date

2020-01-13 Thread ani jaya
phase amp 115 1986 4 25 -0.319090 -0.363030 2 0.483332 526 1987 6 10 1.662870 0.291632 5 1.688250 977 1988 9 3 -0.604950 -0.299850 1 0.675181 1374 198910 5 0.972298 -0.461030 4 1.076060 1760 199010 26 -1.183110 -1.589810 2 1.981730

Re: [R] Subset a data frame with specific date

2020-01-13 Thread ani jaya
jo30[ date[1] == mjo30$Dt, ] > > or > > mjo30[ mjo30$Dt %in% date, ] > > but the subset function would not work in this case because you have two > different objects (a column in mjo30 and a vector in your global environment) > both referred to as 'date'. > > On January 13, 2

[R] Subset a data frame with specific date

2020-01-13 Thread ani jaya
Good morning R-Help, I have a dataframe with 7 columns and 1+ rows. I want to subset/extract those data frame with specific date (not in order). Here the head of my data frame: head(mjo30) year month date rmm1 rmm2 phase amp 1 1986 11 -0.326480 -1.55895 2 1.59277 2

Re: [R] data load from excel files

2019-11-13 Thread ani jaya
; # order the list by year-month > inx_ym <- sapply(pon1, function(DF){ >format(DF[["Tanggal"]][1], "%Y-%m") > }) > pon1 <- pon1[order(inx_ym)] > > > # get the minimum and maximum of every "RR" > min.RR <- sapply(pon1, function(DF) min

[R] data load from excel files

2019-11-12 Thread ani jaya
Dear R-Help, I have 30 of year-based excel files and each file contain month sheets. I have some problem here. My data is daily rainfall but there is extra 1 day (first date of next month) for several sheets. My main goal is to get the minimum value for every month. First, how to extract those

Re: [R] unordered y axis

2019-11-07 Thread ani jaya
> boxed.labels(year,fin_month,month.abb[month],border=NA,cex=0.7) > > Jim > > On Thu, Nov 7, 2019 at 3:35 PM ani jaya wrote: > > > > Dear Jim, > > > > Thank you very much for nice suggestion and figure there. But what I > need is the y axis start from let

Re: [R] unordered y axis

2019-11-06 Thread ani jaya
type="l", ylab="Month", xlab="Year", > main="Month of occurrence in year") > axis(1,at=seq(1981,2014,3)) > library(plotrix) > boxed.labels(year,month,month.abb[month],border=NA,cex=0.7) > > Jim > > On Thu, Nov 7, 2019 at 1:24 PM ani

[R] unordered y axis

2019-11-06 Thread ani jaya
Dear R-Help, I have 35 data that is month when the annual minima happened. So I want to plot those data but the order of y axis is not from 1 to 12, but let say start from 9,10,11,12,1,..8. The reason to do this is when 12 (Dec) meet 1 (Jan) in the following year the graph is not quite good (for

Re: [R] List of data frame

2019-10-20 Thread ani jaya
") > }) > > > Hope this helps, > > Rui Barradas > > Às 02:38 de 18/10/19, ani jaya escreveu: > > Dear R-Help, > > > > I have a list of data frame that I import from excel file using read.xlsx > > command. > > > > sheets <- openx

Re: [R] [FORGED] NA value in list of data frame

2019-10-18 Thread ani jaya
Thank you very much everyone. All fine now!! On Fri, Oct 18, 2019 at 11:42 AM Rolf Turner wrote: > > On 18/10/19 2:43 PM, ani jaya wrote: > > > Dear R-Help, > > > > I have a list of data frame that I import from excel file using read.xlsx > > command. > >

Re: [R] List of data frame

2019-10-17 Thread ani jaya
t;- x== ## rhs is an "index vector" of logicals > > x > [1] 1 2 3 NA > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bl

[R] NA value in list of data frame

2019-10-17 Thread ani jaya
Dear R-Help, I have a list of data frame that I import from excel file using read.xlsx command. sheets <- openxlsx::getSheetNames("rainfall.xlsx") test <- lapply(sheets,function(i) read.xlsx("rainfall.xlsx", sheet=i, startRow=8, cols=1:2)) names(test) <- sprintf("%i", 1986:2015) And I got a

[R] List of data frame

2019-10-17 Thread ani jaya
Dear R-Help, I have a list of data frame that I import from excel file using read.xlsx command. sheets <- openxlsx::getSheetNames("rainfall.xlsx") test <- lapply(sheets,function(i) read.xlsx("rainfall.xlsx", sheet=i, startRow=8, cols=1:2)) names(test) <- sprintf("%i", 1986:2015) And I got a

Re: [R] Looping with looping

2019-04-19 Thread ani jaya
ar(mfrow=c(3,3)) > for(i in seq_along(a)) { > hist(a[[i]], xlab='x', main=sprintf("k = %i", (2:9)[i])) > } > > > > > > On Thu, Apr 18, 2019 at 9:19 AM ani jaya wrote: > > > > Dear R community, > > > > I'm trying to create a looping to se

[R] Looping with looping

2019-04-18 Thread ani jaya
Dear R community, I'm trying to create a looping to see the effect of number of samples from one dataset. Lets say I have 10 values in a single data frame and I want to see the mean of each sampling let say from 2-9 number of sampling. But I want to do the repetition let say up to 100 for each