Displaying 5 results from an estimated 5 matches for "diettyp".
Did you mean:
diettype
2018 Feb 25
4
reshaping column items into rows per unique ID
Hi All
I have a datafram which looks like this :
CustomerID DietType
1 a
1 c
1 b
2 f
2 a
3 j
4 c
4 c
4 f
And I would l...
2018 Feb 25
0
reshaping column items into rows per unique ID
Hi Allaisone,
If you want a data frame as the output you will have to put up with a
few NA values unless each Customer has the same number of diet types:
a1df<-read.table(text="CustomerID DietType
1 a
1 c
1 b
2 f
2 a
3 j
4 c
4 c
4 f",
header=...
2018 Feb 25
0
reshaping column items into rows per unique ID
...oming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Sun, Feb 25, 2018 at 4:59 AM, Allaisone 1 <allaisone1 at hotmail.com> wrote:
> Hi All
>
> I have a datafram which looks like this :
>
> CustomerID DietType
> 1 a
> 1 c
> 1 b
> 2 f
> 2 a
> 3 j
> 4 c
> 4 c
> 4...
2018 Feb 25
1
reshaping column items into rows per unique ID
Hi Allaisone,
I took a slightly different approach but you might find this either as or
more useful than your approach, or at least a start on the path to a
solution you need.
df1 <-
data.frame(CustId=c(1,1,1,2,3,3,4,4,4),DietType=c("a","c","b","f","a","j","c","c","f"),
stringsAsFactors=FALSE)
custs <- unique(df1$CustId)
dtype <- unique(df1$DietType)
nc <- length(custs)
nd <- length(dtype)
df2 &l...
2011 Mar 02
4
Contingency table in R
Hi,
I have a table in R with data I needed and need to create a contingency table out of it. The table I have so far looks like this:
Binger
r
DietType No Yes
Dangerous 15 12
Healthy 52 9
None 134 24
Unhealthy 72 23
These are the error messages that I keep getting whenever I try to get a contingency table. I'm not sure why it won't work for me, any help would be appreciated!
> nametable<-table(excat,reca...