Base de dados

library(readr)
Banco_Moma <- read_delim("https://raw.githubusercontent.com/DATAUNIRIO/Base_de_dados/master/arte_MOMA.csv", delim = ";")

ATIVIDADE 1

Quantas pinturas existem no MoMA? Quantas variáveis existem no banco de dados?

str(Banco_Moma)
## spec_tbl_df [2,253 x 24] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
##  $ X1               : num [1:2253] 1 2 3 4 5 6 7 8 9 10 ...
##  $ title            : chr [1:2253] "Rope and People, I" "Fire in the Evening" "Portrait of an Equilibrist" "Guitar" ...
##  $ artist           : chr [1:2253] "Joan Mir<f3>" "Paul Klee" "Paul Klee" "Pablo Picasso" ...
##  $ artist_bio       : chr [1:2253] "(Spanish, 1893-1983)" "(German, born Switzerland. 1879-1940)" "(German, born Switzerland. 1879-1940)" "(Spanish, 1881-1973)" ...
##  $ artist_birth_year: num [1:2253] 1893 1879 1879 1881 1880 ...
##  $ artist_death_year: num [1:2253] 1983 1940 1940 1973 1946 ...
##  $ num_artists      : num [1:2253] 1 1 1 1 1 1 1 1 1 1 ...
##  $ n_female_artists : num [1:2253] 0 0 0 0 0 0 0 0 0 0 ...
##  $ n_male_artists   : num [1:2253] 1 1 1 1 1 1 1 1 1 1 ...
##  $ artist_gender    : chr [1:2253] "Male" "Male" "Male" "Male" ...
##  $ year_acquired    : num [1:2253] 1936 1970 1966 1955 1939 ...
##  $ year_created     : num [1:2253] 1935 1929 1927 1919 1925 ...
##  $ circumference_cm : logi [1:2253] NA NA NA NA NA NA ...
##  $ depth_cm         : num [1:2253] NA NA NA NA NA NA NA NA NA NA ...
##  $ diameter_cm      : logi [1:2253] NA NA NA NA NA NA ...
##  $ height_cm        : num [1:2253] 1048 338 603 2159 508 ...
##  $ length_cm        : logi [1:2253] NA NA NA NA NA NA ...
##  $ width_cm         : num [1:2253] 746 333 368 787 54 ...
##  $ seat_height_cm   : logi [1:2253] NA NA NA NA NA NA ...
##  $ purchase         : logi [1:2253] FALSE FALSE FALSE FALSE FALSE FALSE ...
##  $ gift             : logi [1:2253] TRUE FALSE FALSE TRUE TRUE FALSE ...
##  $ exchange         : logi [1:2253] FALSE FALSE FALSE FALSE TRUE FALSE ...
##  $ classification   : chr [1:2253] "Painting" "Painting" "Painting" "Painting" ...
##  $ department       : chr [1:2253] "Painting & Sculpture" "Painting & Sculpture" "Painting & Sculpture" "Painting & Sculpture" ...
##  - attr(*, "spec")=
##   .. cols(
##   ..   X1 = col_double(),
##   ..   title = col_character(),
##   ..   artist = col_character(),
##   ..   artist_bio = col_character(),
##   ..   artist_birth_year = col_double(),
##   ..   artist_death_year = col_double(),
##   ..   num_artists = col_double(),
##   ..   n_female_artists = col_double(),
##   ..   n_male_artists = col_double(),
##   ..   artist_gender = col_character(),
##   ..   year_acquired = col_double(),
##   ..   year_created = col_double(),
##   ..   circumference_cm = col_logical(),
##   ..   depth_cm = col_number(),
##   ..   diameter_cm = col_logical(),
##   ..   height_cm = col_number(),
##   ..   length_cm = col_logical(),
##   ..   width_cm = col_number(),
##   ..   seat_height_cm = col_logical(),
##   ..   purchase = col_logical(),
##   ..   gift = col_logical(),
##   ..   exchange = col_logical(),
##   ..   classification = col_character(),
##   ..   department = col_character()
##   .. )

R: Tem um total de 2253 pinturas e 24 variáveis.

ATIVIDADE 2

Qual é a primeira pintura adquirida pelo MoMA? Qual ano? Qual artista? Qual título?

R: Foram duas pinturas adquiridas em 1930. A House by the Railroad, do artista Edward Hopper e a Seated Nude de Bernard Karfiol.

ATIVIDADE 3

Qual é a pintura mais antiga da coleção? Qual ano? Qual artista? Qual título?

R: Landscape at Daybreak, em 1872, do artista Odilon Redon

ATIVIDADE 4

Quantos artistas distintos existem?

library(dplyr)
Banco_Moma %>% group_by(artist) %>% summarise()
## # A tibble: 989 x 1
##    artist                     
##    <chr>                      
##  1 "\xc9douard Vuillard"      
##  2 "\xc9mile Bernard"         
##  3 "\xd6yvind Fahlstr\xf6m"   
##  4 "A. E. Gallatin"           
##  5 "A.R. Penck (Ralf Winkler)"
##  6 "Abraham Palatnik"         
##  7 "Abraham Rattner"          
##  8 "Abraham Walkowitz"        
##  9 "Ad Dekkers"               
## 10 "Ad Reinhardt"             
## # ... with 979 more rows

R: Tem um total de 989 artistas.

ATIVIDADE 5

Qual artista tem mais pinturas na coleção?

library(dlookr)
diagnose(Banco_Moma)
## # A tibble: 24 x 6
##    variables      types   missing_count missing_percent unique_count unique_rate
##    <chr>          <chr>           <int>           <dbl>        <int>       <dbl>
##  1 X1             numeric             0          0              2253     1      
##  2 title          charac~             0          0              2015     0.894  
##  3 artist         charac~             0          0               989     0.439  
##  4 artist_bio     charac~             1          0.0444          859     0.381  
##  5 artist_birth_~ numeric             6          0.266           132     0.0586 
##  6 artist_death_~ numeric           629         27.9             102     0.0453 
##  7 num_artists    numeric             1          0.0444            5     0.00222
##  8 n_female_arti~ numeric             0          0                 3     0.00133
##  9 n_male_artists numeric             0          0                 5     0.00222
## 10 artist_gender  charac~            10          0.444             3     0.00133
## # ... with 14 more rows
diagnose_category(Banco_Moma, artist)
## # A tibble: 10 x 6
##    variables levels               N  freq ratio  rank
##  * <chr>     <chr>            <int> <int> <dbl> <int>
##  1 artist    Pablo Picasso     2253    55  2.44     1
##  2 artist    Henri Matisse     2253    32  1.42     2
##  3 artist    On Kawara         2253    32  1.42     2
##  4 artist    Jacob Lawrence    2253    30  1.33     4
##  5 artist    Batiste Madalena  2253    25  1.11     5
##  6 artist    Jean Dubuffet     2253    25  1.11     5
##  7 artist    Odilon Redon      2253    25  1.11     5
##  8 artist    Ben Vautier       2253    24  1.07     8
##  9 artist    Frank Stella      2253    23  1.02     9
## 10 artist    Philip Guston     2253    23  1.02     9

R: O artista com mais pinturas é Pablo Picasso.

ATIVIDADE 6

Quantas pinturas existem por este artista?

R: Analisando a frequencia na tabela acima, tem 55 pinturas.

ATIVIDADE 7

Quantas pinturas de artistas masculinos e femininos?

table(Banco_Moma$artist_gender)
## 
## Female   Male 
##    252   1991
Banco_Moma %>% count(artist_gender)
## # A tibble: 3 x 2
##   artist_gender     n
##   <chr>         <int>
## 1 Female          252
## 2 Male           1991
## 3 <NA>             10

R: São 1991 pinturas de artistas masculinos, 252 de artistas femininas e 10 obras sem gênero especificado.

ATIVIDADE 8

Quantos artistas de cada gênero existem?

Banco_Moma %>% count(artist_gender,artist) %>%
  count(artist_gender) %>%
  mutate(n = as.character(paste(n, "art"))) %>%
  table()
##              n
## artist_gender 143 art 837 art 9 art
##        Female       1       0     0
##        Male         0       1     0

R: São 837 artistas do genero masculino e 143 artistas do gênero feminino.

ATIVIDADE 9

Em que ano foram adquiridas mais pinturas?

Banco_Moma$year_acquired <- as.factor(Banco_Moma$year_acquired)
diagnose(Banco_Moma)
## # A tibble: 24 x 6
##    variables      types   missing_count missing_percent unique_count unique_rate
##    <chr>          <chr>           <int>           <dbl>        <int>       <dbl>
##  1 X1             numeric             0          0              2253     1      
##  2 title          charac~             0          0              2015     0.894  
##  3 artist         charac~             0          0               989     0.439  
##  4 artist_bio     charac~             1          0.0444          859     0.381  
##  5 artist_birth_~ numeric             6          0.266           132     0.0586 
##  6 artist_death_~ numeric           629         27.9             102     0.0453 
##  7 num_artists    numeric             1          0.0444            5     0.00222
##  8 n_female_arti~ numeric             0          0                 3     0.00133
##  9 n_male_artists numeric             0          0                 5     0.00222
## 10 artist_gender  charac~            10          0.444             3     0.00133
## # ... with 14 more rows
diagnose_category(Banco_Moma, year_acquired)
## # A tibble: 10 x 6
##    variables     levels     N  freq ratio  rank
##  * <chr>         <fct>  <int> <int> <dbl> <int>
##  1 year_acquired 1985    2253    86  3.82     1
##  2 year_acquired 1942    2253    71  3.15     2
##  3 year_acquired 1979    2253    71  3.15     2
##  4 year_acquired 1991    2253    67  2.97     4
##  5 year_acquired 2005    2253    67  2.97     4
##  6 year_acquired 1967    2253    65  2.89     6
##  7 year_acquired 2008    2253    55  2.44     7
##  8 year_acquired 1961    2253    45  2.00     8
##  9 year_acquired 1969    2253    45  2.00     8
## 10 year_acquired 1956    2253    42  1.86    10

R: Em 1985, com um total de 86 pinturas

ATIVIDADE 10

Em que ano foram Criadas mais pinturas?

Banco_Moma$year_created <- as.factor(Banco_Moma$year_created)
diagnose(Banco_Moma)
## # A tibble: 24 x 6
##    variables      types   missing_count missing_percent unique_count unique_rate
##    <chr>          <chr>           <int>           <dbl>        <int>       <dbl>
##  1 X1             numeric             0          0              2253     1      
##  2 title          charac~             0          0              2015     0.894  
##  3 artist         charac~             0          0               989     0.439  
##  4 artist_bio     charac~             1          0.0444          859     0.381  
##  5 artist_birth_~ numeric             6          0.266           132     0.0586 
##  6 artist_death_~ numeric           629         27.9             102     0.0453 
##  7 num_artists    numeric             1          0.0444            5     0.00222
##  8 n_female_arti~ numeric             0          0                 3     0.00133
##  9 n_male_artists numeric             0          0                 5     0.00222
## 10 artist_gender  charac~            10          0.444             3     0.00133
## # ... with 14 more rows
diagnose_category(Banco_Moma, year_created)
## # A tibble: 11 x 6
##    variables    levels     N  freq ratio  rank
##  * <chr>        <fct>  <int> <int> <dbl> <int>
##  1 year_created 1977    2253    57  2.53     1
##  2 year_created 1940    2253    56  2.49     2
##  3 year_created 1964    2253    56  2.49     2
##  4 year_created 1961    2253    50  2.22     4
##  5 year_created 1962    2253    49  2.17     5
##  6 year_created 1963    2253    44  1.95     6
##  7 year_created 1959    2253    42  1.86     7
##  8 year_created 1968    2253    40  1.78     8
##  9 year_created 1960    2253    39  1.73     9
## 10 year_created 1914    2253    37  1.64    10
## 11 year_created 1950    2253    37  1.64    10

R:Em 1977, com um total de 57 pinturas.

CONCLUSÃO

Podemos perceber que existem 2253 pinturas no Museu feitas por um total de 989 artistas diferentes. A mais antiga é datada de 1872, chamada Landscape at Daybreak do artista Odilon Redon. O pintor com mais obras no museu é Paplo Picasso, com um total de 55 obras. Em 1977 foram criadas 57 pinturas, o ano com maior numero de pinturas criadas.