Edgard Leal

My personal blog hosted on Github using Jekyll

Home View on GitHub
04 January 2016

{:br}

chickwts

[caption id="attachment_263" align="alignleft" width="150"]R barplot result R barplot result[/caption]

Este é um DataFrame resultante de um estudo feito com 50 frangos distribuidos aleatoriamente em seis grupos, e cada um deste seis grupos foram alimentados com seis tipos distintos de suplementos. O objetivo deste estudo é identificar o tipo de alimento que propicia o melhor ganho de peso.

R Datasets

Este post faz parte de uma serie de posts sobre os principais Datasets disponíveis com a distribuição padrão do R. Estes Datasets são fontes de dados para auxilio nos estudos, provas de conceitos dentre outros.

Conteúdo

Abaixo pode ser visto uma amostra do conteúdo deste Dataset.

> head(chickwts)
  weight      feed
1    179 horsebean
2    160 horsebean
3    136 horsebean
4    227 horsebean
5    217 horsebean
6    168 horsebean

Uso

Verificando o melhor resultado:

> aggregate(chickwts$weight, by=list(chickwts$feed), FUN=mean)
    Group.1        x
1    casein 323.5833
2 horsebean 160.2000
3   linseed 218.7500
4  meatmeal 276.9091
5   soybean 246.4286
6 sunflower 328.9167

Exibindo os resultados em um gráfico de barras:

result  barplot(result$x, names.arg = result$Group.1)

[caption id="attachment_263" align="alignleft" width="150"]R barplot result R Dataset R barplot result[/caption]

Referências:

http://stat.ethz.ch/R-manual/R-devel/library/datasets/html/chickwts.html{:}{:en}

chickwts

[caption id="attachment_263" align="alignleft" width="150"]R barplot result R barplot result[/caption]

R Dataset ChickenEste DataFrame is a result of a study done on 50 chickens randomized into six groups, and each of the six groups were fed with six different types of supplements. The objective of this study is to identify the type of food that provides the best weight gain.

R Datasets

This post is part of a series of posts on the main Datasets available with the standard distribution of R. These Datasets are data sources to aid in studies, proof of concept and others.

Content

Below can be seen a sample of the contents of this Dataset.

> head(chickwts)
  weight      feed
1    179 horsebean
2    160 horsebean
3    136 horsebean
4    227 horsebean
5    217 horsebean
6    168 horsebean

Usage

Checking the best result:

> aggregate(chickwts$weight, by=list(chickwts$feed), FUN=mean)
    Group.1        x
1    casein 323.5833
2 horsebean 160.2000
3   linseed 218.7500
4  meatmeal 276.9091
5   soybean 246.4286
6 sunflower 328.9167

Displaying the results on a bar graph:

result  barplot(result$x, names.arg = result$Group.1)

[caption id="attachment_263" align="alignleft" width="150"]R barplot result R Dataset R barplot result[/caption]

References

http://stat.ethz.ch/R-manual/R-devel/library/datasets/html/chickwts.html{:}



blog comments powered by Disqus