Re: [R] find multiple mode, sorry for not providing enough information

2020-03-15 Thread Jeff Newmiller
Anyone following along on the mailing list cannot see your "red text" since this is a plain text mailing list. Please set your email format to "plain text" when sending messages to the R mailing lists so you don't fool yourself into thinking we can see HTML formatting. It will also avoid corrup

Re: [R] find multiple mode, sorry for not providing enough information

2020-03-15 Thread Yuan Chun Ding
You **might** do better pursuing this sort of thing on the Bioconductor site: https://www.bioconductor.org/help/ They often have professionally written R

Re: [R] find multiple mode, sorry for not providing enough information

2020-03-15 Thread Bert Gunter
You **might** do better pursuing this sort of thing on the Bioconductor site: https://www.bioconductor.org/help/ They often have professionally written R packages tailored for genomics so that you don't need to shake and bake your own with all the dangers that entails (not least of which may be tha

Re: [R] find multiple mode

2020-03-15 Thread Yuan Chun Ding
sorry, this is not a homework question although I am working at home now due to COVID19 virus spreading in California. I tried to write a function to convert input data file. > tem4$Var1 [1] 13 4 5 67 8 9 10 11 12 13 14 15 16 17 18 20 21 2223 24 25

Re: [R] find multiple mode, sorry for not providing enough information

2020-03-15 Thread Yuan Chun Ding
sorry, I just came back. Yes, Abby's understanding is right. > tem4$Var1 [1] 13 4 5 67 8 9 10 11 12 13 14 15 16 17 18 20 21 2223 24 25 31 > tem4$Freq [1] 1 2 5 5 10 4 4 8 11882431 21 1 13

Re: [R] How to make our data normally distributed in R

2020-03-15 Thread Jin Li
Please note that mu and sd are the mean and standard deviation of validation samples. You may use pred.acc in spm to calculate a number of error and accuracy measures including RMSE and VEcv from the observed and predicted values directly. On Sat, Mar 14, 2020 at 2:07 AM Neha gupta wrote: > Than

Re: [R] find multiple mode

2020-03-15 Thread Duncan Murdoch
On 15/03/2020 6:42 p.m., Abby Spurdle wrote: I think people have misinterpreted the question. The OP wants local maxima from the series. The original series is frequencies, so your table is frequencies of frequencies. A solution can be derived by looking at signs of the first and second differe

Re: [R] find multiple mode

2020-03-15 Thread Abby Spurdle
I think people have misinterpreted the question. The OP wants local maxima from the series. The original series is frequencies, so your table is frequencies of frequencies. A solution can be derived by looking at signs of the first and second differences. But there may be a simpler way On Mo

Re: [R] find multiple mode

2020-03-15 Thread Rui Barradas
Hello, There is StackOverflow question on mode finding [1]. There is also a RPubs post, with the following now rewritten as a function. Mode <- function(x){ y <- table(x) names(y)[which(y == max(y))] } Mode(freq) #[1] "1" is.na(freq) <- freq == 1 Mode(freq) #[1] "2" "4" "8" [1] https://s

Re: [R] find multiple mode

2020-03-15 Thread Sorkin, John
Ding, Perhaps I am missing something. First, if you know the modes, why do you need to look for them? Second, I don�t believe the modes are as you stated, 10, 8, and 149. John Sent from Mail for Windows 10 From: Yuan Chun Ding

Re: [R] find multiple mode

2020-03-15 Thread Jim Lemon
Hi Ding, Translating this into R code: freq<-c(1,2,5,5,10,4,4,8,1,1,8,8,2,4,3,1,2,1,1,138,149,14,1,1) > table(freq) freq 1 2 3 4 5 8 10 14 138 149 8 3 1 3 2 3 1 1 1 1 > library(prettyR) > Mode(freq) [1] "1" You have a single modal value (1). If there were at most t

[R] find multiple mode

2020-03-15 Thread Yuan Chun Ding
Hi R users, I want to find multiple modes (10, 8, 149) for the following vector. freq =1,2,5,5 10,4,4,8,1,1,8,8,2,4,3,1,2,1,1 138 149 14,1,1; any suggestion? Thank you, Ding -- --

Re: [R] fit for truncated normal distribution

2020-03-15 Thread |Juergen Hedderich
Many thanks for all the helpful hints. There is probably a bug in dtruncnorm() from library(truncnorm). The workround with function dtnorm() from library(exactDistr) works fine! /> //library(fitdistrplus); library(extraDistr) //Lade nötiges Paket: MASS //Lade nötiges Paket: survival //Lade nöti