2016-04-15 5 views

答えて

0

これはあなたにとって便利かもしれないと思います。

## creating a matrix 
> data_frame <- matrix(c(0.8,0.2,0.7,0.3),2,2) 
> data_frame 
    [,1] [,2] 
[1,] 0.8 0.7 
[2,] 0.2 0.3 

## setting the dimension names 
> dimnames(data_frame) <- list(c('Handwash','No Handwash'),c('Female','Male')) 

## plotting the data 

barplot(data_frame,col=rep(c('orange','skyblue'),ncol(data_frame)),legend.text = dimnames(data_frame)[[1]],ylab='Frequency') 

enter image description here

関連する問題