Re: [R] cygwin clipboard

2019-05-22 Thread Abby Spurdle
> I'd like to be able to access the windows clipboard from R under Cygwin. > Is this supported in any way? Thanks Hi Ed You can access the Windows clipboard under Cygwin. I ran R within Cygwin. I was able to use read.table (file="clipboard") for both plain text and Excel tables. > #table

Re: [R] Calculating date difference in days

2019-05-22 Thread Jeff Newmiller
At the point where you say "date difference in days" IMO you have departed from what `difftime` is for and are in the realm of a numeric measure. I ignore the units inside `difftime` at all times and convert to numeric with a units argument if I want to be that specific about how the measure is

Re: [R] Calculating date difference in days

2019-05-22 Thread William Dunlap via R-help
You can use units<- to change the time units of the difference. E.g., > d <- as.POSIXlt("2018-03-10") - as.POSIXlt("2018-03-09 02:00:00") > d Time difference of 22 hours > units(d) <- "days" > d Time difference of 0.917 days > > units(d) <- "mins" > d Time difference of 1320 mins > units(d)

Re: [R] Calculating date difference in days

2019-05-22 Thread Boris Steipe
ed <- as.POSIXlt("2018-03-10") sd <- as.POSIXlt("2018-02-10") as.numeric(ed-sd) [1] 28 ed <- as.POSIXlt("2000-03-10") sd <- as.POSIXlt("2000-02-10") as.numeric(ed-sd) [1] 29 Cheers, B. > On 2019-05-22, at 17:43, reichm...@sbcglobal.net wrote: > > R Help > > I have a function to calculate a

[R] Calculating date difference in days

2019-05-22 Thread reichmanj
R Help I have a function to calculate a date difference in days but my results come back in hours. I suspect I am using the as.POSIXlt function incorrectly . Suggestions? # Start time of data to be considered start_day <- "2016-04-30" # Make event and sequence IDs into factors elapsed_days

Re: [R] Problema estrazione file in formato "large STFDF" in formato "ASCII" compatibile con GIS

2019-05-22 Thread Michael Dewey
Dear Agostino I am afraid this list is an English language one but I suggest that as well as trying to translate your message you post on the list which specialises in this sort of thing https://stat.ethz.ch/mailman/listinfo/r-sig-geo where they may be better able to help you. Michael On

[R] Problema estrazione file in formato "large STFDF" in formato "ASCII" compatibile con GIS

2019-05-22 Thread Agostino Della Porta
Salve, mi sto occupando nel mio tirocinio di analisi di dati spazio-temporali con il Kriging spazio-temporale. Una volta ottenuta la mappa di predizione con questa riga di codice: pred <- krigeST ( PPB ~ 1 , data = dataSTIDF , modelList = simpleSumMetric_Vgm, newdata = grid.ST, fullCovariance =

Re: [R] Help with R coding

2019-05-22 Thread Bill Poling
Thank you William appreciate your response Sir. WHP From: William Michels Sent: Wednesday, May 22, 2019 9:58 AM To: Bill Poling Cc: r-help (r-help@r-project.org) Subject: Re: [R] Help with R coding Morning Bill, I take it this is dplyr? You might try: tmp1 <- HCPC %>% group_by(HCPCSCode)

Re: [R] Significance of difference in means using Monte Carlo Simulation in R

2019-05-22 Thread Bert Gunter
This list is for Help and usually expects you to first show us your own efforts. You need to do your own homework and spend some time with one or more of the many good R tutorials on the Web. Some suggestions canbe found here, though you will find many more by simple web searches:

Re: [R] Help with R coding

2019-05-22 Thread Bill Poling
Thank you Jeff! WHP From: Jeff Newmiller Sent: Wednesday, May 22, 2019 10:06 AM To: r-help@r-project.org; Rui Barradas ; Bill Poling ; r-help (r-help@r-project.org) Subject: Re: [R] Help with R coding Generally more efficient to filter before grouping. Note that summarize clears out

Re: [R] Help with R coding

2019-05-22 Thread Jeff Newmiller
Generally more efficient to filter before grouping. Note that summarize clears out whatever isn't mentioned in it, so the subsetting currently being done in the mean call could also be done in the pre-filter step and you can avoid filtering other columns and then discarding them by limiting

Re: [R] Help with R coding

2019-05-22 Thread William Michels via R-help
Morning Bill, I take it this is dplyr? You might try: tmp1 <- HCPC %>% group_by(HCPCSCode) %>% summarise(Avg_AllowByLimit = mean(Avg_AllowByLimit[which(Avg_AllowByLimit!=0 & AllowByLimitFlag == TRUE)])) The code above gives "NaN" for cases where AllowByLimitFlag == FALSE. Maybe this is the

Re: [R] Help with R coding

2019-05-22 Thread Bill Poling
Thank you Rui, but that is getting me the overall mean not the mean of just the observations that are flagged as TRUE Grouped By the HCPCSCode (AllowByLimitFlag == TRUE). I also tried adding it to the filter you suggested but that does not seem to work either? tmp1 <- tmp %>%

Re: [R] Help with R coding

2019-05-22 Thread Rui Barradas
Hello, Maybe filter the AllowByLimitFlag values first (not tested)? tmp1 <- tmp %>% group_by(HCPCSCode) %>% filter(AllowByLimitFlag) %>% summarise(Avg_AllowByLimit = mean(Avg_AllowByLimit[which(Avg_AllowByLimit!=0)])) Hope this helps, Rui Barradas Às 13:35 de 22/05/19, Bill Poling

[R] Help with R coding

2019-05-22 Thread Bill Poling
Good morning. #R version 3.6.0 Patched (2019-05-19 r76539) #Platform: x86_64-w64-mingw32/x64 (64-bit) #Running under: Windows >= 8 x64 (build 9200) I need a calculated field For the Rate of Avg_AllowByLimit where the Allowed_AmtFlag = TRUE BY Each Code I have almost got this. #So far I have

Re: [R] cygwin clipboard

2019-05-22 Thread peter dalgaard
What Duncan says, but in case you are feeling adventurous or have strong reasons to be in the Cygwin parallel universe, notice that the error indicates that R is loooking for an X11 display. So, at a minimum, you need to have (a) an X11 display server running (b) R setup so that it knows how

[R] Significance of difference in means using Monte Carlo Simulation in R

2019-05-22 Thread Lyndz
I want to implement a statistical test by the following paper in R: https://journals.ametsoc.org/doi/full/10.1175/JCLI4217.1 **Details** The above paper calculates the significance of the difference in means between two periods :1961-1983 and 1984-2000 of tropical cyclone passage frequency