Skip to content
Back to formatted view

Raw Message

Message-ID: <CA+8X3fXo23v5br4=e75TYJmPaccgC5mT_WBWi=w5=npcqqMx+g@mail.gmail.com>
Date: 2017-09-21T22:05:22Z
From: Jim Lemon
Subject: List of occuring values
In-Reply-To: <trinity-5a6447af-3a31-4b0c-88d1-0d7da705991e-1505998883548@3c-app-gmx-bs68>

Hi Ferri,
Do you mean getting something like the vector of original values back?

boodat<-sample(LETTERS[1:4],100,TRUE)
bootab<-table(boodat)
untab<-function(x) {
 lenx<-length(x)
 newx<-NULL
 for(i in 1:lenx) newx<-c(newx,rep(names(x)[i],x[i]))
 return(newx)
}
untab(bootab)

Jim

On Thu, Sep 21, 2017 at 11:01 PM, Ferri Leberl <ferri.leberl at gmx.at> wrote:
>
> Dear all,
> ftable produces a list of the frequencies of all occuring values.
> But how about the occuring values?
> How can I retrieve a list of occuring values?
> How can I retrieve a table with both the list of occuring values and their respective frequencies?
> Thank you in advance,
> Yours, Ferri
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.