Re: [R] cumulative data monthly

2019-01-28 Thread Diego Avesani
Dear Jeff, Dear Rui, Dear all, Forget about the monthly things. I was trying to do two things at the same time. I try to explain myself. Thanks for your time and I really appreciate your help. I have a long file with hourly precipitation from 2000 to 2018. I would like to select only on e year o

Re: [R] cumulative data monthly

2019-01-28 Thread Rui Barradas
Hello, With on«bjects of class "Date" or "POSIXt", POSIXct" you can do lubridate::year(date_obj) to extract the year. Then aggregate by it. Hope this helps, Rui Barradas Às 08:25 de 28/01/2019, Diego Avesani escreveu: Dear Jeff, Dear Rui, Dear all, Forget about the monthly things. I was tr

Re: [R] troubleshooting data structure to run krippendorff's alpha

2019-01-28 Thread Jim Lemon
Hi Halllie, As Jeff noted, a data frame is not a matrix (it is a variety of list), so that looks like your problem. hkdf<-data.frame(sample(3:5,4,TRUE),sample(1:3,4,TRUE),sample(2:4,4,TRUE), sample(3:5,4,TRUE),sample(1:3,4,TRUE),sample(2:4,4,TRUE)) library(irr) kripp.alpha(hkdf) kripp.alpha(as.ma

[R] [R-pkgs] permuco: permutation tests and multiple comparisons.

2019-01-28 Thread Jaromil Frossard
Hello everyone, We present you the permuco package, which has 2 main purposes: PERmutation tests and MUltiple COmparisons. First, the package has functions for permutation tests for parameters in linear models with nuisance variables. Several permutation methods exist in the literature to redu

Re: [R] cumulative data monthly

2019-01-28 Thread Rui Barradas
Hello, Please click to keep this threaded. What I was trying to say is to do something along the lines of Y <- lubridate::year(dati$DATAORA) Y2013 <- Y[Y == 2013] PY2013 <- ave(dati$PREC, Y2013, FUN = cumsum) plot(dati$DATAORA, PY2013) Hope this helps, Rui Barradas Às 08:57 de 28/01/2019,

[R] duplicates including first occurrence

2019-01-28 Thread Knut Krueger via R-help
Ho to all i get the results mtcars[duplicated(mtcars$wt,fromLast=TRUE),] Hornet Sportabout 18.7 8 360.0 175 3.15 3.44 17.02 0 032 Duster 36014.3 8 360.0 245 3.21 3.57 15.84 0 034 Merc 280 19.2 6 167.6 123 3.92 3.44 18.30 1 044 mtcars[duplic

Re: [R] duplicates including first occurrence

2019-01-28 Thread Rui Barradas
Hello, Simply OR (|) both conditions. mtcars[duplicated(mtcars$wt) | duplicated(mtcars$wt,fromLast=TRUE),] # mpg cyl disp hp drat wt qsec vs am gear carb #Hornet Sportabout 18.7 8 360.0 175 3.15 3.44 17.02 0 032 #Duster 36014.3 8 360.0 245 3.21 3.57 1

Re: [R] duplicates including first occurrence

2019-01-28 Thread Bert Gunter
... Alternatively(but probably less efficient): ## the indexing logical vector with(mtcars, wt %in% wt[duplicated(wt)] ) cheers, Bert 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 "Bloom

Re: [R] positive deviance plot for Binomial distribution

2019-01-28 Thread greg holly
Hi Jeff; Thanks so much for this. I would try to reformulate what you suggested. Your help is highly appreciated Regards, Greg On Sun, Jan 27, 2019 at 8:16 PM Jeff Newmiller wrote: > I haven't found much call to mess with this, but I think the built-in > "glm" function could do it. You might

[R] Randomization Test

2019-01-28 Thread Ogbos Okike
Dear Contributors, I conducting epoch analysis. I tried to test the significance of my result using randomization test. Since I have 71 events, I randomly selected another 71 events, making sure that none of the dates in the random events corresponds with the ones in the real event. Following th

Re: [R] troubleshooting data structure to run krippendorff's alpha

2019-01-28 Thread Hallie Kamesch
Hi all, Thank you for your responses. You are correct that it is not a matrix. I used the incorrect term. I meant I put my data in a spreadsheet with three rows and 24 columns. Sent from my iPhone > On Jan 28, 2019, at 3:36 AM, Jim Lemon wrote: > > Hi Halllie, > As Jeff noted, a data frame

[R] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Alan Feuerbacher
Hi, I recently learned of the existence of R through a physicist friend who uses it in his research. I've used Octave for a decade, and C for 35 years, but would like to learn R. These all have advantages and disadvantages for certain tasks, but as I'm new to R I hardly know how to evaluate t

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Rolf Turner
On 1/29/19 10:05 AM, Alan Feuerbacher wrote: Hi, I recently learned of the existence of R through a physicist friend who uses it in his research. I've used Octave for a decade, and C for 35 years, but would like to learn R. These all have advantages and disadvantages for certain tasks, but

Re: [R] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Gabor Grothendieck
R has many similarities to Octave. Have a look at: https://cran.r-project.org/doc/contrib/R-and-octave.txt https://CRAN.R-project.org/package=matconv On Mon, Jan 28, 2019 at 4:58 PM Alan Feuerbacher wrote: > > Hi, > > I recently learned of the existence of R through a physicist friend who > use

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Alan Feuerbacher
On 1/28/2019 4:20 PM, Rolf Turner wrote: On 1/29/19 10:05 AM, Alan Feuerbacher wrote: Hi, I recently learned of the existence of R through a physicist friend who uses it in his research. I've used Octave for a decade, and C for 35 years, but would like to learn R. These all have advantages

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Bert Gunter
I would say your question is foolish -- you disagree no doubt! -- because the point of using R (or Octave or C++) is to take advantage of the packages (= "libraries" in some languages; a library is something different in R) it (or they) offers to simplify your task. Many of R's libraries are writte

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Gabor Grothendieck
This would be a suitable application for NetLogo. The R package RNetLogo provides an interface. In a few lines of code you get a simulation with graphics. On Mon, Jan 28, 2019 at 7:00 PM Alan Feuerbacher wrote: > > On 1/28/2019 4:20 PM, Rolf Turner wrote: > > > > On 1/29/19 10:05 AM, Alan Feuer

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread William Dunlap via R-help
S (R's predecessor) was designed by and for data analysts. R generally follows that tradition. I think that simulations such as yours are not its strength, although it can make analyzing (graphically and numerically) the results of the simulation fun. Bill Dunlap TIBCO Software wdunlap tibco.com

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread Jeff Newmiller
If you forge on with your preconceptions of how such a simulation should be implemented then you will be able to reproduce your failure just as spectacularly using R as you did using Octave. It is crucial to employ vectorization of your algorithms if you want good performance with either Octave

[R] [R-pkgs] mgcViz: scalable ggplot2 visualisations for mgcv

2019-01-28 Thread Matteo Fasiolo
Dear useRs, I am pleased to announce the publication of mgcViz 0.1.3 on CRAN: https://cran.r-project.org/web/packages/mgcViz/index.html mgcViz is an extension of mgcv, and provides a layered ggplot2-based visualisation framework for GAM models. In addition to layered smooth effect plots, mgcViz

[R] R package installation error

2019-01-28 Thread Christian Martin Hennig
Hi there, I'm running R version 3.5.2 on Linux Mint. I try install.packages("hierfstat") and get this: ** byte-compile and prepare package for lazy loading Error in rbind(info, getNamespaceInfo(env, "S3methods")) : number of columns of matrices must match (see arg 2) ERROR: lazy loading faile

[R] Recommendations for a package capable of doing latent class regression with mixed indicator types

2019-01-28 Thread Weiwen Ng, MPH
Dear R users, Does anyone have a recommendation for an R package that can: 1. Handle mixed types of indicators (in my case, both binary and Gaussian) 2. Fit a latent class regression (i.e. use observed covariates to predict latent class membership)? 3. Incorporate programs to do th

Re: [R] [FORGED] Newbie Question on R versus Matlab/Octave versus C

2019-01-28 Thread David Winsemius
On 1/28/19 4:00 PM, Alan Feuerbacher wrote: On 1/28/2019 4:20 PM, Rolf Turner wrote: On 1/29/19 10:05 AM, Alan Feuerbacher wrote: Hi, I recently learned of the existence of R through a physicist friend who uses it in his research. I've used Octave for a decade, and C for 35 years, but wo