On 15-Dec-09 13:35:36, Jorge Ivan Velez wrote:
> Dear Maithili,
> Here are two suggestions:
>
># data set
> x <- read.table(textConnection("Name no_of_instances
> AAA 12
> AA17
> A 0
> BBB 11
> BB 6
> B 0
> C 8
> D 3"), header = TRUE)
> closeAllConnections()
> x
>
Dear Maithili,
Here are two suggestions:
# data set
x <- read.table(textConnection("Name no_of_instances
AAA 12
AA17
A 0
BBB 11
BB 6
B 0
C 8
D 3"), header = TRUE)
closeAllConnections()
x
# option 1
do.call(c,with(x, tapply(no_of_instances, Name, runif)))
# option
Dear R helpers
I have following table
Name no_of_instances
AAA 12
AA 17
A 0
3 matches
Mail list logo