Re: [R] Split a DF on Date column for each single year

2019-03-15 Thread Jeff Newmiller
Couldn't you just use the substr function to pull the year out yourself to make the grouping column? On March 15, 2019 10:40:01 PM PDT, Ek Esawi wrote: >Hi All— > >I have a data frame with over 13000 rows and 4 columns. A mini data >frame is given at the bottom. I want to split the data frame

[R] Split a DF on Date column for each single year

2019-03-15 Thread Ek Esawi
Hi All— I have a data frame with over 13000 rows and 4 columns. A mini data frame is given at the bottom. I want to split the data frame into lists each corresponds to single year which ranges from 1990 to 2018). I wanted to use the split function, but it requires a vector of the same length as

Re: [R] density vs. mass for discrete probability functions

2019-03-15 Thread JLucke
Stefan--- Under the measure-theoretic approach to probability, discrete & continuous probability densities follow the same underlying mathematical principles. Check any text on measure-theoretic probability theory. ---JFL Stefan Schreiber Sent by: "R-help" 03/14/2019 08:43 PM To

Re: [ESS] ESS+Polymode Questions

2019-03-15 Thread Marc Schwartz via ESS-help
Note: Re-sending my reply below, as I noted that even though I did reply-all, the ESS list was not included in the reply... Apologies. Marc > On Mar 13, 2019, at 6:12 AM, Vitalie Spinu wrote: > > > >>> On Thu, Mar 07 2019 12:17, Marc Schwartz via ESS-help wrote: that defines

Re: [R] Help with gsub function

2019-03-15 Thread Jeff Newmiller
Your pattern seems ... way overboard? Why not gsub("-", "", tb2a$TID) On March 15, 2019 12:45:27 PM PDT, Bill Poling wrote: >Good afternoon. > >sessionInfo() >#R version 3.5.3 (2019-03-11) >#Platform: x86_64-w64-mingw32/x64 (64-bit) >#Running under: Windows >= 8 x64 (build 9200) > >I am using

Re: [R] Help with gsub function

2019-03-15 Thread Peter Langfelder
If you want to remove just the hyphen, why not do sub("-", "", tb2a$TID) sub("-", "", "73-017323") [1] "73017323" Am I missing something? Peter On Fri, Mar 15, 2019 at 12:46 PM Bill Poling wrote: > > Good afternoon. > > sessionInfo() > #R version 3.5.3 (2019-03-11) > #Platform:

Re: [R] Help with gsub function

2019-03-15 Thread Ivan Krylov
On Fri, 15 Mar 2019 19:45:27 + Bill Poling wrote: Hello Bill, > tb2a$TID2 <- gsub(tb2a$TID, pattern="-[0-0]{0,7}", replacement = "") Is the pattern supposed to mean something besides the "-" you want to remove? For the problem you describe, pattern="-" should be enough. It should locate

[R] Help with gsub function

2019-03-15 Thread Bill Poling
Good afternoon. sessionInfo() #R version 3.5.3 (2019-03-11) #Platform: x86_64-w64-mingw32/x64 (64-bit) #Running under: Windows >= 8 x64 (build 9200) I am using gsub function to remove a hyphen in a 9 character column of values in order to convert it to integer. Works fine except where the

Re: [R] density vs. mass for discrete probability functions

2019-03-15 Thread Spencer Graves
On 2019-03-15 08:37, peter dalgaard wrote: Mathematically, you can bring discrete and continuous distributions on a common footing by defining probability functions as densities wrt. counting measure. You don't really need Radon-Nikodym derivatives to understand the idea, just the fact

Re: [R] 3.5.3

2019-03-15 Thread Spencer Graves
On 2019-03-15 08:54, Jeff Newmiller wrote: You really need to get into better touch with your feelings, man... how are we supposed to know what you want? ;-) In general you should be using the main release unless you know there is a bug in it that affects you and has specifically been

Re: [R] 3.5.3

2019-03-15 Thread Jeff Newmiller
You really need to get into better touch with your feelings, man... how are we supposed to know what you want? ;-) In general you should be using the main release unless you know there is a bug in it that affects you and has specifically been addressed in the patched version. The patched

Re: [R] 3.5.3

2019-03-15 Thread peter dalgaard
You generally only want the patched version if it is known to fix something that you need. As 3.5.3 is intended as the wrap-up release of 3.5.x, it is quite likely that the two will only ever differ by name. -pd > On 15 Mar 2019, at 14:29 , Bill Poling wrote: > > Good morning. > > This may

Re: [R] density vs. mass for discrete probability functions

2019-03-15 Thread peter dalgaard
Mathematically, you can bring discrete and continuous distributions on a common footing by defining probability functions as densities wrt. counting measure. You don't really need Radon-Nikodym derivatives to understand the idea, just the fact that sums can be interpreted as integrals wrt

[R] 3.5.3

2019-03-15 Thread Bill Poling
Good morning. This may have already been asked, if so my appologies. I want to upgrade to 3.5.3 however there is an alternative called patched. Do I want it or the basic 3.5.3? Thank you.

Re: [R] Stratifying data with xyplot

2019-03-15 Thread Deepayan Sarkar
On Tue, Mar 12, 2019 at 2:28 AM Kevin Wright wrote: > > See the examples here: > https://www.stat.ubc.ca/~jenny/STAT545A/block10_latticeNittyGritty.html Excellent reference. The only improvement I could think of is to abuse the non-standard evaluation of 'groups' to avoid repeating the name of

Re: [R] [mgcv] Memory issues with bam() on computer cluster

2019-03-15 Thread Simon Wood
Can you supply the results of sessionInfo() please, and the full bam call that causes this. best, Simon (mgcv maintainer) On 15/03/2019 09:09, Frank van Berkum wrote: > Dear Community, > > In our current research we are trying to fit Generalized Additive Models to a > large dataset. We are

Re: [R] density vs. mass for discrete probability functions

2019-03-15 Thread Spencer Graves
On 2019-03-14 19:43, Stefan Schreiber wrote: Dear R users, While experimenting with the dbinom() function and reading its documentation (?dbinom) it reads that "dbinom gives the density" but shouldn't it be called "mass" instead of "density"? I assume that it has something to do with keeping

Re: [R] Extract data of special character

2019-03-15 Thread Rui Barradas
Hello, Something like this? old_par <- par(mar = par("mar") + c(5, 0, -2, 0)) boxplot(SCORE ~ ATTRIBUTE, dd, cex.axis = 0.6, las = 2) par(old_par) Hope this helps, Rui Barradas Às 00:06 de 15/03/2019, roslinazairimah zakaria escreveu: Hi Rui and Ivan, Yes both works well.

[R] density vs. mass for discrete probability functions

2019-03-15 Thread Stefan Schreiber
Dear R users, While experimenting with the dbinom() function and reading its documentation (?dbinom) it reads that "dbinom gives the density" but shouldn't it be called "mass" instead of "density"? I assume that it has something to do with keeping the function for "density" consistent across

Re: [R] Extract data of special character

2019-03-15 Thread Ivan Krylov
В Fri, 15 Mar 2019 08:06:52 +0800 roslinazairimah zakaria пишет: > I want to draw boxplot for each individual score of the > attributes. You mean, a box per every possible ATTRIBUTE value? This is easily doable with the bwplot() function from library(lattice). -- Best regards, Ivan

Re: [R] Sorting vector based on pairs of comparisons

2019-03-15 Thread Jim Lemon
Hi Bert, Good reference and David Urbina's example showed that a simple swap was position dependent. The reason I pursued this is that it seems more efficient to sequentially apply the precedence rules to the arbitrarily sorted elements of the vector than to go through the directed graph approach.

Re: [R] Display common color scale on multiple scatter3D plots

2019-03-15 Thread Luigi Marongiu
Thank you! I even bought a manual on this and such feature was not there. Case solved. Regards, Luigi On Thu, Mar 14, 2019 at 11:36 PM Jim Lemon wrote: > > Hi Luigi, > Upon careful reading of the help page, you can do it with scatter3D: > > scatter3D(X, Y, Z, col.var = Z, pch = 16, cex =

[R] [mgcv] Memory issues with bam() on computer cluster

2019-03-15 Thread Frank van Berkum
Dear Community, In our current research we are trying to fit Generalized Additive Models to a large dataset. We are using the package mgcv in R. Our dataset contains about 22 million records with less than 20 risk factors for each observation, so in our case n>>p. The dataset covers the period

Re: [R] Sorting vector based on pairs of comparisons

2019-03-15 Thread Pedro Conte de Barros
Thanks Bert. Excellent reference, I learned a lot from it! Just a note: I did use search engines for at least 2 days before posting. BUT as often happens, I did not use the right keywords. I tried several variants of "Convert ordered pairs to sorted", "Sort vector on paired comparisons" and

Re: [R] Sorting vector based on pairs of comparisons

2019-03-15 Thread Bert Gunter
If I understand correctly, the answer is a topological sort. Here is an explanation https://davidurbina.blog/on-partial-order-total-order-and-the-topological-sort/ This was found by a simple web search on "Convert partial ordering to total ordering" Btw. Please use search engines before