Nico,

It is unclear to me what sort of result you are looking for.
Can you give an example of what the output would look like using the
example data you provided?

You can look at the occurrence of names and places using the table()
function,
     table(a$name, a$place)
or you could look at the mean value for each name/place combination using
the tapply() function,
     tapply(a$value, list(a$name, a$place), mean)

Jean





On Mon, Jun 3, 2013 at 8:41 AM, Nico Met <nicomet80@gmail.com> wrote:

> Dear all,
>
> I would like to split the data based on the "place" and then would like to
> see how many "names" were common in place with corresponding "value" .
>
> Please find a demo file.
>
> Thanks for your expert comment
>
> best
>
> Nico
>
> > dput(dta)
> structure(list(place = structure(c(3L, 2L, 5L, 6L, 4L, 3L, 2L,
> 5L, 6L, 4L, 2L, 5L, 6L, 4L, 2L, 5L, 6L, 4L, 2L, 3L, 2L, 5L, 6L,
> 4L, 3L, 2L, 5L, 6L, 4L, 5L, 6L, 4L, 5L, 6L, 1L), .Label = c("",
> "GCKT", "IKLI", "KLOI", "PLRT", "POIV"), class = "factor"), name =
> structure
> (c(2L,
> 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 2L, 3L, 4L, 5L, 6L,
> 7L, 8L, 9L, 10L, 11L, 12L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
> 11L, 12L, 12L, 1L), .Label = c("", "P_CK23", "P_CK24", "P_CK25",
> "P_CK26", "P_CK27", "P_CK28", "P_CK29", "P_CK30", "P_CK31", "P_CK32",
> "P_CK33"), class = "factor"), value = c(5.9464, 6.0786, -4.5155,
> 15.0241, -38.1847, -0.0861, 1.2757, -23.9914, 9.5951, -11.128,
> 6.2826, 23.5218, 20.862, 3.1626, 6.242, -20.5348, -14.0126, -13.796,
> 15.3869, -15.7409, -8.1963, -14.4522, 3.2117, -1.2738, 14.3556,
> -12.5337, 20.4308, -3.3227, -34.802, -11.1103, -9.7146, -35.9044,
> -9.4303, -28.1949, NA)), .Names = c("place", "name", "value"), class =
> "data
> .frame", row.names = c(NA,
> 35L))
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> 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.
>

	[[alternative HTML version deleted]]

