Re: [R] How to obtain a cross tab count of unique values

2015-03-31 Thread Tom Wright
table(unique(df)$PROJECT) On Tue, 2015-03-31 at 14:51 -0500, Walter Anderson wrote: > I have a data frame that shows all of the parks (including duplicates) > that are impacted by a projects 'footprint': > > PROJECT PARKNAME > A PRK A > A PRK B > A PRK A > B PRK C > B

Re: [R] How to obtain a cross tab count of unique values

2015-03-31 Thread Rui Barradas
Hello, Try the following. table(unique(df)$PROJECT) And please note that 'df' is the name of an R function, use something else. Hope this helps, Rui Barradas Em 31-03-2015 20:51, Walter Anderson escreveu: I have a data frame that shows all of the parks (including duplicates) that are impac

Re: [R] How to obtain a cross tab count of unique values

2015-03-31 Thread Sarah Goslee
Sure: tell R you want unique rows. > mydf <- data.frame(PROJECT=c("A","A","A","B","B","C","C"), PARKNAME=c("PRK > A", "PRK B", "PRK A", "PRK C", "PRK A", "PRK B", "PRK D"), > stringsAsFactors=FALSE) > mydf PROJECT PARKNAME 1 APRK A 2 APRK B 3 APRK A 4 BP

[R] How to obtain a cross tab count of unique values

2015-03-31 Thread Walter Anderson
I have a data frame that shows all of the parks (including duplicates) that are impacted by a projects 'footprint': PROJECT PARKNAME A PRK A A PRK B A PRK A B PRK C B PRK A C PRK B C PRK D ... What I need is a cross tabulation that shows me the number of