knitr::opts_chunk$set(echo = TRUE)
options(digits=2)

Passo 0: Carregando a base de dados: Museu de Arte Moderna

library(readxl)

arte_MOMA <- read_excel("C:/Users/User/Desktop/atividade 6/arte_MOMA.xls")
## New names:
## * `` -> ...1
View(arte_MOMA)

Passo 1: Fazendo a transformação das variáveis qualitativas da base de dados Museu de Arte Moderna:

summary(arte_MOMA)
##       ...1         title              artist           artist_bio       
##  Min.   :   1   Length:2253        Length:2253        Length:2253       
##  1st Qu.: 564   Class :character   Class :character   Class :character  
##  Median :1127   Mode  :character   Mode  :character   Mode  :character  
##  Mean   :1127                                                           
##  3rd Qu.:1690                                                           
##  Max.   :2253                                                           
##                                                                         
##  artist_birth_year  artist_death_year       age      num_artists       
##  Length:2253        Length:2253        Min.   : 27   Length:2253       
##  Class :character   Class :character   1st Qu.: 67   Class :character  
##  Mode  :character   Mode  :character   Median : 77   Mode  :character  
##                                        Mean   : 75                     
##                                        3rd Qu.: 85                     
##                                        Max.   :102                     
##                                        NA's   :629                     
##  n_female_artists n_male_artists artist_gender      year_acquired     
##  Min.   :0.00     Min.   :0.0    Length:2253        Length:2253       
##  1st Qu.:0.00     1st Qu.:1.0    Class :character   Class :character  
##  Median :0.00     Median :1.0    Mode  :character   Mode  :character  
##  Mean   :0.11     Mean   :0.9                                         
##  3rd Qu.:0.00     3rd Qu.:1.0                                         
##  Max.   :2.00     Max.   :9.0                                         
##                                                                       
##  year_created       circumference_cm     depth_cm         diameter_cm       
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##    height_cm     length_cm            width_cm    seat_height_cm    
##  Min.   :   7   Length:2253        Min.   :   4   Length:2253       
##  1st Qu.:  61   Class :character   1st Qu.:  61   Class :character  
##  Median : 107   Mode  :character   Median :  99   Mode  :character  
##  Mean   : 124                      Mean   : 132                     
##  3rd Qu.: 182                      3rd Qu.: 170                     
##  Max.   :1011                      Max.   :4663                     
##                                                                     
##    purchase             gift             exchange         classification    
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##   department       
##  Length:2253       
##  Class :character  
##  Mode  :character  
##                    
##                    
##                    
## 
arte_MOMA$artist_gender<-ifelse(arte_MOMA$n_female_artists==0,"Sim","Não")
arte_MOMA$artist<-ifelse(arte_MOMA$num_artists==1,"Sim","Não")
arte_MOMA$artist<-ifelse(arte_MOMA$artist)

summary(arte_MOMA)
##       ...1         title            artist         artist_bio       
##  Min.   :   1   Length:2253        Mode:logical   Length:2253       
##  1st Qu.: 564   Class :character   NA's:2253      Class :character  
##  Median :1127   Mode  :character                  Mode  :character  
##  Mean   :1127                                                       
##  3rd Qu.:1690                                                       
##  Max.   :2253                                                       
##                                                                     
##  artist_birth_year  artist_death_year       age      num_artists       
##  Length:2253        Length:2253        Min.   : 27   Length:2253       
##  Class :character   Class :character   1st Qu.: 67   Class :character  
##  Mode  :character   Mode  :character   Median : 77   Mode  :character  
##                                        Mean   : 75                     
##                                        3rd Qu.: 85                     
##                                        Max.   :102                     
##                                        NA's   :629                     
##  n_female_artists n_male_artists artist_gender      year_acquired     
##  Min.   :0.00     Min.   :0.0    Length:2253        Length:2253       
##  1st Qu.:0.00     1st Qu.:1.0    Class :character   Class :character  
##  Median :0.00     Median :1.0    Mode  :character   Mode  :character  
##  Mean   :0.11     Mean   :0.9                                         
##  3rd Qu.:0.00     3rd Qu.:1.0                                         
##  Max.   :2.00     Max.   :9.0                                         
##                                                                       
##  year_created       circumference_cm     depth_cm         diameter_cm       
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##    height_cm     length_cm            width_cm    seat_height_cm    
##  Min.   :   7   Length:2253        Min.   :   4   Length:2253       
##  1st Qu.:  61   Class :character   1st Qu.:  61   Class :character  
##  Median : 107   Mode  :character   Median :  99   Mode  :character  
##  Mean   : 124                      Mean   : 132                     
##  3rd Qu.: 182                      3rd Qu.: 170                     
##  Max.   :1011                      Max.   :4663                     
##                                                                     
##    purchase             gift             exchange         classification    
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##   department       
##  Length:2253       
##  Class :character  
##  Mode  :character  
##                    
##                    
##                    
## 

Passo 2: Trabalhando com a base de dados Museu de Arte Moderna e com várias variáveis ao mesmo tempo:

Eis algumas variáveis que serão utilizadas para responder as perguntas:

variável: títulos

variável: artistas

variável: local de nascimento

variável: ano de nascimento

variável: classificação

Passo 3: Criando tabelas com algumas variáveis de interesse para esse trabalho:

Tabelas das variáveis utilizadas para responder as perguntas:

table(arte_MOMA$classification) 
## 
## Painting 
##     2253
table(arte_MOMA$year_acquired) 
## 
## 1930 1931 1932 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 
##    2    2    1   14   22   18   19    8   31   18   39   71   22   17   15    5 
## 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 
##   14   11   29   23   27   20   22   30   36   42   18   39   37   34   45   21 
## 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 
##   33   36   38   23   65   20   45   37   28    7   16   11   24   19   17   21 
## 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 
##   71   20   23   20   30   15   86   15   11    8    7   26   67   30    7   41 
## 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 
##   13   33   21   26   24   29   11   25    4   27   67   21   13   55   21   18 
## 2011 2012 2013 2014 2015 2016 2017   NA 
##   27   27   22   20   21   33   17    9
table(arte_MOMA$year_acquired) 
## 
## 1930 1931 1932 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 
##    2    2    1   14   22   18   19    8   31   18   39   71   22   17   15    5 
## 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 
##   14   11   29   23   27   20   22   30   36   42   18   39   37   34   45   21 
## 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 
##   33   36   38   23   65   20   45   37   28    7   16   11   24   19   17   21 
## 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 
##   71   20   23   20   30   15   86   15   11    8    7   26   67   30    7   41 
## 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 
##   13   33   21   26   24   29   11   25    4   27   67   21   13   55   21   18 
## 2011 2012 2013 2014 2015 2016 2017   NA 
##   27   27   22   20   21   33   17    9
table(arte_MOMA$n_female_artists) 
## 
##    0    1    2 
## 1998  254    1
table(arte_MOMA$n_male_artists) 
## 
##    0    1    2    3    9 
##  254 1992    2    4    1
table(arte_MOMA$classification,arte_MOMA$n_female_artists) 
##           
##               0    1    2
##   Painting 1998  254    1
table(arte_MOMA$classification,arte_MOMA$n_male_artists)  
##           
##               0    1    2    3    9
##   Painting  254 1992    2    4    1
table(arte_MOMA$classification,arte_MOMA$artist) 
## < table of extent 1 x 0 >
table(arte_MOMA$department,arte_MOMA$artist_gender) 
##                             
##                               Não  Sim
##   Film                          0   26
##   Fluxus Collection             1    4
##   Media and Performance Art     0    3
##   Painting & Sculpture        254 1941
##   Prints & Illustrated Books    0   24
table(arte_MOMA$n_female_artists)
## 
##    0    1    2 
## 1998  254    1
table(arte_MOMA$n_male_artists)  
## 
##    0    1    2    3    9 
##  254 1992    2    4    1
table(arte_MOMA$classification,arte_MOMA$n_female_artists) 
##           
##               0    1    2
##   Painting 1998  254    1
table(arte_MOMA$classification,arte_MOMA$n_male_artists)
##           
##               0    1    2    3    9
##   Painting  254 1992    2    4    1
table(arte_MOMA$year_acquired,arte_MOMA$classification) 
##       
##        Painting
##   1930        2
##   1931        2
##   1932        1
##   1934       14
##   1935       22
##   1936       18
##   1937       19
##   1938        8
##   1939       31
##   1940       18
##   1941       39
##   1942       71
##   1943       22
##   1944       17
##   1945       15
##   1946        5
##   1947       14
##   1948       11
##   1949       29
##   1950       23
##   1951       27
##   1952       20
##   1953       22
##   1954       30
##   1955       36
##   1956       42
##   1957       18
##   1958       39
##   1959       37
##   1960       34
##   1961       45
##   1962       21
##   1963       33
##   1964       36
##   1965       38
##   1966       23
##   1967       65
##   1968       20
##   1969       45
##   1970       37
##   1971       28
##   1972        7
##   1973       16
##   1974       11
##   1975       24
##   1976       19
##   1977       17
##   1978       21
##   1979       71
##   1980       20
##   1981       23
##   1982       20
##   1983       30
##   1984       15
##   1985       86
##   1986       15
##   1987       11
##   1988        8
##   1989        7
##   1990       26
##   1991       67
##   1992       30
##   1993        7
##   1994       41
##   1995       13
##   1996       33
##   1997       21
##   1998       26
##   1999       24
##   2000       29
##   2001       11
##   2002       25
##   2003        4
##   2004       27
##   2005       67
##   2006       21
##   2007       13
##   2008       55
##   2009       21
##   2010       18
##   2011       27
##   2012       27
##   2013       22
##   2014       20
##   2015       21
##   2016       33
##   2017       17
##   NA          9
table(arte_MOMA$year_created,arte_MOMA$classification) 
##       
##        Painting
##   1872        1
##   1875        6
##   1879        2
##   1882        1
##   1883        2
##   1885        2
##   1886        1
##   1887        2
##   1888        4
##   1889        5
##   1890        2
##   1891        1
##   1892        2
##   1893        3
##   1894        2
##   1895        3
##   1896        1
##   1897        2
##   1898        1
##   1899        2
##   1900        6
##   1901        1
##   1902        2
##   1903        1
##   1904        1
##   1905       11
##   1906        6
##   1907       15
##   1908       14
##   1909       12
##   1910       18
##   1911       19
##   1912       33
##   1913       21
##   1914       37
##   1915       18
##   1916       11
##   1917       14
##   1918       13
##   1919        9
##   1920       11
##   1921       13
##   1922       13
##   1923       11
##   1924       14
##   1925       25
##   1926       23
##   1927       27
##   1928       32
##   1929       22
##   1930       21
##   1931       13
##   1932       21
##   1933       13
##   1934       13
##   1935       16
##   1936       15
##   1937       18
##   1938       24
##   1939       26
##   1940       56
##   1941       24
##   1942       31
##   1943       18
##   1944       28
##   1945       13
##   1946       22
##   1947       18
##   1948       25
##   1949       32
##   1950       37
##   1951       16
##   1952       27
##   1953       27
##   1954       23
##   1955       28
##   1956       34
##   1957       32
##   1958       26
##   1959       42
##   1960       39
##   1961       50
##   1962       49
##   1963       44
##   1964       56
##   1965       36
##   1966       36
##   1967       26
##   1968       40
##   1969       29
##   1970       17
##   1971       13
##   1972       19
##   1973       16
##   1974       26
##   1975       19
##   1976       26
##   1977       57
##   1978       13
##   1979       23
##   1980       10
##   1981       27
##   1982       13
##   1983       13
##   1984       31
##   1985       15
##   1986       12
##   1987       24
##   1988       11
##   1989       12
##   1990        5
##   1991        9
##   1992        9
##   1993        6
##   1994        9
##   1995        5
##   1996        6
##   1997       10
##   1998        4
##   1999        3
##   2000       10
##   2001        8
##   2002        7
##   2003        5
##   2004        6
##   2005       19
##   2006        6
##   2007        4
##   2008       22
##   2009        6
##   2010        4
##   2011       11
##   2012        5
##   2013       13
##   2014        7
##   2015        6
##   2016        2
##   2017        2
##   NA          5
table(arte_MOMA$year_acquired,arte_MOMA$artist_gender) 
##       
##        Não Sim
##   1930   0   2
##   1931   0   2
##   1932   0   1
##   1934   0  14
##   1935   1  21
##   1936   2  16
##   1937   2  17
##   1938   1   7
##   1939   2  29
##   1940   3  15
##   1941   3  36
##   1942   9  62
##   1943   0  22
##   1944   2  15
##   1945   3  12
##   1946   1   4
##   1947   2  12
##   1948   2   9
##   1949   2  27
##   1950   1  22
##   1951   2  25
##   1952   2  18
##   1953   1  21
##   1954   1  29
##   1955   0  36
##   1956   5  37
##   1957   0  18
##   1958   3  36
##   1959   0  37
##   1960   2  32
##   1961   2  43
##   1962   1  20
##   1963   4  29
##   1964   3  33
##   1965   7  31
##   1966   0  23
##   1967   9  56
##   1968   3  17
##   1969   2  43
##   1970   5  32
##   1971   1  27
##   1972   1   6
##   1973   6  10
##   1974   0  11
##   1975   1  23
##   1976   1  18
##   1977   1  16
##   1978   3  18
##   1979   7  64
##   1980   1  19
##   1981   1  22
##   1982   1  19
##   1983   1  29
##   1984   0  15
##   1985   2  84
##   1986   0  15
##   1987   1  10
##   1988   0   8
##   1989   0   7
##   1990   1  25
##   1991   3  64
##   1992   3  27
##   1993   2   5
##   1994   7  34
##   1995   1  12
##   1996   4  29
##   1997   1  20
##   1998   3  23
##   1999   2  22
##   2000   7  22
##   2001   3   8
##   2002  14  11
##   2003   0   4
##   2004   6  21
##   2005  12  55
##   2006   7  14
##   2007   0  13
##   2008   9  46
##   2009   6  15
##   2010   4  14
##   2011   7  20
##   2012   9  18
##   2013   5  17
##   2014   0  20
##   2015   4  17
##   2016   7  26
##   2017   8   9
##   NA     4   5
table(arte_MOMA$year_created,arte_MOMA$classification)
##       
##        Painting
##   1872        1
##   1875        6
##   1879        2
##   1882        1
##   1883        2
##   1885        2
##   1886        1
##   1887        2
##   1888        4
##   1889        5
##   1890        2
##   1891        1
##   1892        2
##   1893        3
##   1894        2
##   1895        3
##   1896        1
##   1897        2
##   1898        1
##   1899        2
##   1900        6
##   1901        1
##   1902        2
##   1903        1
##   1904        1
##   1905       11
##   1906        6
##   1907       15
##   1908       14
##   1909       12
##   1910       18
##   1911       19
##   1912       33
##   1913       21
##   1914       37
##   1915       18
##   1916       11
##   1917       14
##   1918       13
##   1919        9
##   1920       11
##   1921       13
##   1922       13
##   1923       11
##   1924       14
##   1925       25
##   1926       23
##   1927       27
##   1928       32
##   1929       22
##   1930       21
##   1931       13
##   1932       21
##   1933       13
##   1934       13
##   1935       16
##   1936       15
##   1937       18
##   1938       24
##   1939       26
##   1940       56
##   1941       24
##   1942       31
##   1943       18
##   1944       28
##   1945       13
##   1946       22
##   1947       18
##   1948       25
##   1949       32
##   1950       37
##   1951       16
##   1952       27
##   1953       27
##   1954       23
##   1955       28
##   1956       34
##   1957       32
##   1958       26
##   1959       42
##   1960       39
##   1961       50
##   1962       49
##   1963       44
##   1964       56
##   1965       36
##   1966       36
##   1967       26
##   1968       40
##   1969       29
##   1970       17
##   1971       13
##   1972       19
##   1973       16
##   1974       26
##   1975       19
##   1976       26
##   1977       57
##   1978       13
##   1979       23
##   1980       10
##   1981       27
##   1982       13
##   1983       13
##   1984       31
##   1985       15
##   1986       12
##   1987       24
##   1988       11
##   1989       12
##   1990        5
##   1991        9
##   1992        9
##   1993        6
##   1994        9
##   1995        5
##   1996        6
##   1997       10
##   1998        4
##   1999        3
##   2000       10
##   2001        8
##   2002        7
##   2003        5
##   2004        6
##   2005       19
##   2006        6
##   2007        4
##   2008       22
##   2009        6
##   2010        4
##   2011       11
##   2012        5
##   2013       13
##   2014        7
##   2015        6
##   2016        2
##   2017        2
##   NA          5
summary(arte_MOMA$age)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##      27      67      77      75      85     102     629
table(arte_MOMA$age)
## 
##  27  28  29  30  31  32  34  35  36  37  38  39  40  41  42  43  44  45  46  47 
##   2   1   1   2   1   5  15   4   6   4   3   1   7   4   1   2  31   1   1   9 
##  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67 
##   6   1  12  14  18   3  23  18  10  12   9  28   3  18   8  11  15  31  34  72 
##  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87 
##  19  33  20  33  46  29  77  39  64  30  48  27  46  31  30  84  46  82  73  24 
##  88  89  90  91  92  93  94  95  96  97  98  99 101 102 
##  28  33  50  27  88  21  15   5  10   2   7   6   3   1
table(arte_MOMA$age,arte_MOMA$n_female_artists) 
##      
##        0  1  2
##   27   2  0  0
##   28   1  0  0
##   29   1  0  0
##   30   2  0  0
##   31   0  1  0
##   32   4  1  0
##   34  12  3  0
##   35   2  2  0
##   36   6  0  0
##   37   4  0  0
##   38   3  0  0
##   39   1  0  0
##   40   7  0  0
##   41   3  1  0
##   42   1  0  0
##   43   2  0  0
##   44  31  0  0
##   45   1  0  0
##   46   1  0  0
##   47   6  3  0
##   48   6  0  0
##   49   0  1  0
##   50  11  1  0
##   51  14  0  0
##   52  15  3  0
##   53   3  0  0
##   54  20  3  0
##   55  17  1  0
##   56  10  0  0
##   57  12  0  0
##   58   9  0  0
##   59  28  0  0
##   60   3  0  0
##   61  18  0  0
##   62   7  1  0
##   63   8  3  0
##   64  12  3  0
##   65  29  2  0
##   66  34  0  0
##   67  55 17  0
##   68  15  4  0
##   69  29  4  0
##   70  20  0  0
##   71  33  0  0
##   72  43  3  0
##   73  23  6  0
##   74  75  2  0
##   75  38  1  0
##   76  61  3  0
##   77  30  0  0
##   78  47  1  0
##   79  27  0  0
##   80  45  1  0
##   81  28  3  0
##   82  29  1  0
##   83  79  5  0
##   84  41  5  0
##   85  81  1  0
##   86  68  5  0
##   87  22  2  0
##   88  26  2  0
##   89  25  8  0
##   90  50  0  0
##   91  26  1  0
##   92  79  9  0
##   93  20  1  0
##   94  13  2  0
##   95   4  1  0
##   96   8  2  0
##   97   2  0  0
##   98   7  0  0
##   99   2  4  0
##   101  2  1  0
##   102  0  1  0
table(arte_MOMA$age,arte_MOMA$n_male_artists)
##      
##        0  1  2  3  9
##   27   0  2  0  0  0
##   28   0  1  0  0  0
##   29   0  1  0  0  0
##   30   0  2  0  0  0
##   31   1  0  0  0  0
##   32   1  4  0  0  0
##   34   3 12  0  0  0
##   35   2  2  0  0  0
##   36   0  6  0  0  0
##   37   0  4  0  0  0
##   38   0  3  0  0  0
##   39   0  1  0  0  0
##   40   0  7  0  0  0
##   41   1  3  0  0  0
##   42   0  1  0  0  0
##   43   0  2  0  0  0
##   44   0 31  0  0  0
##   45   0  1  0  0  0
##   46   0  1  0  0  0
##   47   3  6  0  0  0
##   48   0  6  0  0  0
##   49   1  0  0  0  0
##   50   1 11  0  0  0
##   51   0 14  0  0  0
##   52   3 15  0  0  0
##   53   0  3  0  0  0
##   54   3 20  0  0  0
##   55   1 17  0  0  0
##   56   0 10  0  0  0
##   57   0 12  0  0  0
##   58   0  9  0  0  0
##   59   0 28  0  0  0
##   60   0  3  0  0  0
##   61   0 18  0  0  0
##   62   0  7  0  0  1
##   63   3  8  0  0  0
##   64   3 12  0  0  0
##   65   2 29  0  0  0
##   66   0 34  0  0  0
##   67  17 55  0  0  0
##   68   3 16  0  0  0
##   69   4 29  0  0  0
##   70   0 20  0  0  0
##   71   0 33  0  0  0
##   72   3 43  0  0  0
##   73   6 23  0  0  0
##   74   2 75  0  0  0
##   75   1 38  0  0  0
##   76   3 61  0  0  0
##   77   0 30  0  0  0
##   78   1 47  0  0  0
##   79   0 27  0  0  0
##   80   1 45  0  0  0
##   81   3 28  0  0  0
##   82   1 29  0  0  0
##   83   5 79  0  0  0
##   84   5 41  0  0  0
##   85   1 81  0  0  0
##   86   5 67  1  0  0
##   87   2 22  0  0  0
##   88   2 26  0  0  0
##   89   8 25  0  0  0
##   90   0 50  0  0  0
##   91   1 26  0  0  0
##   92   9 79  0  0  0
##   93   1 20  0  0  0
##   94   2 13  0  0  0
##   95   1  4  0  0  0
##   96   2  8  0  0  0
##   97   0  2  0  0  0
##   98   0  7  0  0  0
##   99   4  2  0  0  0
##   101  1  2  0  0  0
##   102  1  0  0  0  0
summary(arte_MOMA) 
##       ...1         title            artist         artist_bio       
##  Min.   :   1   Length:2253        Mode:logical   Length:2253       
##  1st Qu.: 564   Class :character   NA's:2253      Class :character  
##  Median :1127   Mode  :character                  Mode  :character  
##  Mean   :1127                                                       
##  3rd Qu.:1690                                                       
##  Max.   :2253                                                       
##                                                                     
##  artist_birth_year  artist_death_year       age      num_artists       
##  Length:2253        Length:2253        Min.   : 27   Length:2253       
##  Class :character   Class :character   1st Qu.: 67   Class :character  
##  Mode  :character   Mode  :character   Median : 77   Mode  :character  
##                                        Mean   : 75                     
##                                        3rd Qu.: 85                     
##                                        Max.   :102                     
##                                        NA's   :629                     
##  n_female_artists n_male_artists artist_gender      year_acquired     
##  Min.   :0.00     Min.   :0.0    Length:2253        Length:2253       
##  1st Qu.:0.00     1st Qu.:1.0    Class :character   Class :character  
##  Median :0.00     Median :1.0    Mode  :character   Mode  :character  
##  Mean   :0.11     Mean   :0.9                                         
##  3rd Qu.:0.00     3rd Qu.:1.0                                         
##  Max.   :2.00     Max.   :9.0                                         
##                                                                       
##  year_created       circumference_cm     depth_cm         diameter_cm       
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##    height_cm     length_cm            width_cm    seat_height_cm    
##  Min.   :   7   Length:2253        Min.   :   4   Length:2253       
##  1st Qu.:  61   Class :character   1st Qu.:  61   Class :character  
##  Median : 107   Mode  :character   Median :  99   Mode  :character  
##  Mean   : 124                      Mean   : 132                     
##  3rd Qu.: 182                      3rd Qu.: 170                     
##  Max.   :1011                      Max.   :4663                     
##                                                                     
##    purchase             gift             exchange         classification    
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##   department       
##  Length:2253       
##  Class :character  
##  Mode  :character  
##                    
##                    
##                    
## 
table(arte_MOMA$age,arte_MOMA$n_female_artists)   
##      
##        0  1  2
##   27   2  0  0
##   28   1  0  0
##   29   1  0  0
##   30   2  0  0
##   31   0  1  0
##   32   4  1  0
##   34  12  3  0
##   35   2  2  0
##   36   6  0  0
##   37   4  0  0
##   38   3  0  0
##   39   1  0  0
##   40   7  0  0
##   41   3  1  0
##   42   1  0  0
##   43   2  0  0
##   44  31  0  0
##   45   1  0  0
##   46   1  0  0
##   47   6  3  0
##   48   6  0  0
##   49   0  1  0
##   50  11  1  0
##   51  14  0  0
##   52  15  3  0
##   53   3  0  0
##   54  20  3  0
##   55  17  1  0
##   56  10  0  0
##   57  12  0  0
##   58   9  0  0
##   59  28  0  0
##   60   3  0  0
##   61  18  0  0
##   62   7  1  0
##   63   8  3  0
##   64  12  3  0
##   65  29  2  0
##   66  34  0  0
##   67  55 17  0
##   68  15  4  0
##   69  29  4  0
##   70  20  0  0
##   71  33  0  0
##   72  43  3  0
##   73  23  6  0
##   74  75  2  0
##   75  38  1  0
##   76  61  3  0
##   77  30  0  0
##   78  47  1  0
##   79  27  0  0
##   80  45  1  0
##   81  28  3  0
##   82  29  1  0
##   83  79  5  0
##   84  41  5  0
##   85  81  1  0
##   86  68  5  0
##   87  22  2  0
##   88  26  2  0
##   89  25  8  0
##   90  50  0  0
##   91  26  1  0
##   92  79  9  0
##   93  20  1  0
##   94  13  2  0
##   95   4  1  0
##   96   8  2  0
##   97   2  0  0
##   98   7  0  0
##   99   2  4  0
##   101  2  1  0
##   102  0  1  0
table(arte_MOMA$age,arte_MOMA$n_male_artists)
##      
##        0  1  2  3  9
##   27   0  2  0  0  0
##   28   0  1  0  0  0
##   29   0  1  0  0  0
##   30   0  2  0  0  0
##   31   1  0  0  0  0
##   32   1  4  0  0  0
##   34   3 12  0  0  0
##   35   2  2  0  0  0
##   36   0  6  0  0  0
##   37   0  4  0  0  0
##   38   0  3  0  0  0
##   39   0  1  0  0  0
##   40   0  7  0  0  0
##   41   1  3  0  0  0
##   42   0  1  0  0  0
##   43   0  2  0  0  0
##   44   0 31  0  0  0
##   45   0  1  0  0  0
##   46   0  1  0  0  0
##   47   3  6  0  0  0
##   48   0  6  0  0  0
##   49   1  0  0  0  0
##   50   1 11  0  0  0
##   51   0 14  0  0  0
##   52   3 15  0  0  0
##   53   0  3  0  0  0
##   54   3 20  0  0  0
##   55   1 17  0  0  0
##   56   0 10  0  0  0
##   57   0 12  0  0  0
##   58   0  9  0  0  0
##   59   0 28  0  0  0
##   60   0  3  0  0  0
##   61   0 18  0  0  0
##   62   0  7  0  0  1
##   63   3  8  0  0  0
##   64   3 12  0  0  0
##   65   2 29  0  0  0
##   66   0 34  0  0  0
##   67  17 55  0  0  0
##   68   3 16  0  0  0
##   69   4 29  0  0  0
##   70   0 20  0  0  0
##   71   0 33  0  0  0
##   72   3 43  0  0  0
##   73   6 23  0  0  0
##   74   2 75  0  0  0
##   75   1 38  0  0  0
##   76   3 61  0  0  0
##   77   0 30  0  0  0
##   78   1 47  0  0  0
##   79   0 27  0  0  0
##   80   1 45  0  0  0
##   81   3 28  0  0  0
##   82   1 29  0  0  0
##   83   5 79  0  0  0
##   84   5 41  0  0  0
##   85   1 81  0  0  0
##   86   5 67  1  0  0
##   87   2 22  0  0  0
##   88   2 26  0  0  0
##   89   8 25  0  0  0
##   90   0 50  0  0  0
##   91   1 26  0  0  0
##   92   9 79  0  0  0
##   93   1 20  0  0  0
##   94   2 13  0  0  0
##   95   1  4  0  0  0
##   96   2  8  0  0  0
##   97   0  2  0  0  0
##   98   0  7  0  0  0
##   99   4  2  0  0  0
##   101  1  2  0  0  0
##   102  1  0  0  0  0
tabela1<-table(arte_MOMA$classification) 
tabela2<-table(arte_MOMA$year_acquired) 
tabela3<-table(arte_MOMA$year_acquired) 
tabela4a<-table(arte_MOMA$n_female_artists) 
tabela4b<-table(arte_MOMA$n_male_artists) 
tabela4c<-table(arte_MOMA$classification,arte_MOMA$n_female_artists) 
tabela4d<-table(arte_MOMA$classification,arte_MOMA$n_male_artists)  
tabelax<-table(arte_MOMA$classification,arte_MOMA$artist) 
tabela6<-table(arte_MOMA$department,arte_MOMA$artist_gender) 
tabela8a<-table(arte_MOMA$n_female_artists)
tabela8b<-table(arte_MOMA$n_male_artists)  
tabela8c<-table(arte_MOMA$classification,arte_MOMA$n_female_artists) 
tabela8d<-table(arte_MOMA$classification,arte_MOMA$n_male_artists)
tabela9<-table(arte_MOMA$year_acquired,arte_MOMA$classification) 
tabela10<-table(arte_MOMA$year_created,arte_MOMA$classification) 
tabela11a<-table(arte_MOMA$year_acquired,arte_MOMA$artist_gender) 
tabela11b<-table(arte_MOMA$year_created,arte_MOMA$classification)
tabela12a<-summary(arte_MOMA$age)
tabela12b<-table(arte_MOMA$age)
tabela12c<-table(arte_MOMA$age,arte_MOMA$n_female_artists) 
tabela12d<-table(arte_MOMA$age,arte_MOMA$n_male_artists)
tabela13<-summary(arte_MOMA) 
tabela14a<-table(arte_MOMA$age,arte_MOMA$n_female_artists)   
tabela14b<-table(arte_MOMA$age,arte_MOMA$n_male_artists)

Passo 4: Respondendo as perguntas propostas:

Conhecendo os dados:

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

R: 2253 pinturas e 24 variáveis distintas.

table(arte_MOMA$classification)
## 
## Painting 
##     2253
  1. Qual é a primeira pintura adquirida pelo MoMA? Qual ano? Qual artista? Qual título?

R: A primeira pintura foi adquirida no ano de 1930. As duas pinturas adquiridas em 1930 foram dos artistas: Joan Miró e Paul Klee. Os títulos dessas duas obras são respectivamente: Rope and People e Fire in the Evening.

table(arte_MOMA$year_acquired)
## 
## 1930 1931 1932 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 
##    2    2    1   14   22   18   19    8   31   18   39   71   22   17   15    5 
## 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 
##   14   11   29   23   27   20   22   30   36   42   18   39   37   34   45   21 
## 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 
##   33   36   38   23   65   20   45   37   28    7   16   11   24   19   17   21 
## 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 
##   71   20   23   20   30   15   86   15   11    8    7   26   67   30    7   41 
## 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 
##   13   33   21   26   24   29   11   25    4   27   67   21   13   55   21   18 
## 2011 2012 2013 2014 2015 2016 2017   NA 
##   27   27   22   20   21   33   17    9
  1. Qual é a pintura mais antiga da coleção? Qual ano? Qual artista? Qual título?

R: As pinturas mais antigas são as obras: Rope and People e Fire in the Evening. Ambas são do ano de 1930. Seus criadores foram Rope and People e Fire in the Evening respectivamente.

table(arte_MOMA$year_acquired)
## 
## 1930 1931 1932 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 
##    2    2    1   14   22   18   19    8   31   18   39   71   22   17   15    5 
## 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 
##   14   11   29   23   27   20   22   30   36   42   18   39   37   34   45   21 
## 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 
##   33   36   38   23   65   20   45   37   28    7   16   11   24   19   17   21 
## 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 
##   71   20   23   20   30   15   86   15   11    8    7   26   67   30    7   41 
## 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 
##   13   33   21   26   24   29   11   25    4   27   67   21   13   55   21   18 
## 2011 2012 2013 2014 2015 2016 2017   NA 
##   27   27   22   20   21   33   17    9
  1. Quantos artistas distintos existem?

R: São 255 artistas femininos e 261 artistas masculinos. Logo, são 516 artistas distintos.

table(arte_MOMA$n_female_artists)
## 
##    0    1    2 
## 1998  254    1
table(arte_MOMA$n_male_artists)
## 
##    0    1    2    3    9 
##  254 1992    2    4    1
table(arte_MOMA$classification,arte_MOMA$n_female_artists)
##           
##               0    1    2
##   Painting 1998  254    1
table(arte_MOMA$classification,arte_MOMA$n_male_artists)
##           
##               0    1    2    3    9
##   Painting  254 1992    2    4    1
  1. Qual artista tem mais pinturas na coleção?

R: Pablo Picasso.

table(arte_MOMA$classification,arte_MOMA$artist)
## < table of extent 1 x 0 >
  1. Quantas pinturas existem por este artista?

R: Pablo Picasso tem 55 pinturas expostas no Museu de Arte Moderna.

table(arte_MOMA$classification,arte_MOMA$artist)
## < table of extent 1 x 0 >
  1. Quantas pinturas de artistas masculinos e femininos?

R: São 251 pinturas realizadas por mulheres e 1935 pinturas feitas por homens.

table(arte_MOMA$department,arte_MOMA$artist_gender)
##                             
##                               Não  Sim
##   Film                          0   26
##   Fluxus Collection             1    4
##   Media and Performance Art     0    3
##   Painting & Sculpture        254 1941
##   Prints & Illustrated Books    0   24
  1. Quantos artistas de cada gênero existem?

R: São 255 artistas femininos e 261 artistas masculinos.

table(arte_MOMA$n_female_artists)
## 
##    0    1    2 
## 1998  254    1
table(arte_MOMA$n_male_artists)
## 
##    0    1    2    3    9 
##  254 1992    2    4    1
table(arte_MOMA$classification,arte_MOMA$n_female_artists)
##           
##               0    1    2
##   Painting 1998  254    1
table(arte_MOMA$classification,arte_MOMA$n_male_artists)
##           
##               0    1    2    3    9
##   Painting  254 1992    2    4    1
  1. Em que ano foram adquiridas mais pinturas?

R: Em 1985, quando foram adquiridas 86 pinturas pelo Museu de Arte Moderna.

table(arte_MOMA$year_acquired,arte_MOMA$classification)
##       
##        Painting
##   1930        2
##   1931        2
##   1932        1
##   1934       14
##   1935       22
##   1936       18
##   1937       19
##   1938        8
##   1939       31
##   1940       18
##   1941       39
##   1942       71
##   1943       22
##   1944       17
##   1945       15
##   1946        5
##   1947       14
##   1948       11
##   1949       29
##   1950       23
##   1951       27
##   1952       20
##   1953       22
##   1954       30
##   1955       36
##   1956       42
##   1957       18
##   1958       39
##   1959       37
##   1960       34
##   1961       45
##   1962       21
##   1963       33
##   1964       36
##   1965       38
##   1966       23
##   1967       65
##   1968       20
##   1969       45
##   1970       37
##   1971       28
##   1972        7
##   1973       16
##   1974       11
##   1975       24
##   1976       19
##   1977       17
##   1978       21
##   1979       71
##   1980       20
##   1981       23
##   1982       20
##   1983       30
##   1984       15
##   1985       86
##   1986       15
##   1987       11
##   1988        8
##   1989        7
##   1990       26
##   1991       67
##   1992       30
##   1993        7
##   1994       41
##   1995       13
##   1996       33
##   1997       21
##   1998       26
##   1999       24
##   2000       29
##   2001       11
##   2002       25
##   2003        4
##   2004       27
##   2005       67
##   2006       21
##   2007       13
##   2008       55
##   2009       21
##   2010       18
##   2011       27
##   2012       27
##   2013       22
##   2014       20
##   2015       21
##   2016       33
##   2017       17
##   NA          9
  1. Em que ano foram criadas mais pinturas?

R: Em 1977.Nesse ano foram criadas 57 pinturas.

table(arte_MOMA$year_created,arte_MOMA$classification)
##       
##        Painting
##   1872        1
##   1875        6
##   1879        2
##   1882        1
##   1883        2
##   1885        2
##   1886        1
##   1887        2
##   1888        4
##   1889        5
##   1890        2
##   1891        1
##   1892        2
##   1893        3
##   1894        2
##   1895        3
##   1896        1
##   1897        2
##   1898        1
##   1899        2
##   1900        6
##   1901        1
##   1902        2
##   1903        1
##   1904        1
##   1905       11
##   1906        6
##   1907       15
##   1908       14
##   1909       12
##   1910       18
##   1911       19
##   1912       33
##   1913       21
##   1914       37
##   1915       18
##   1916       11
##   1917       14
##   1918       13
##   1919        9
##   1920       11
##   1921       13
##   1922       13
##   1923       11
##   1924       14
##   1925       25
##   1926       23
##   1927       27
##   1928       32
##   1929       22
##   1930       21
##   1931       13
##   1932       21
##   1933       13
##   1934       13
##   1935       16
##   1936       15
##   1937       18
##   1938       24
##   1939       26
##   1940       56
##   1941       24
##   1942       31
##   1943       18
##   1944       28
##   1945       13
##   1946       22
##   1947       18
##   1948       25
##   1949       32
##   1950       37
##   1951       16
##   1952       27
##   1953       27
##   1954       23
##   1955       28
##   1956       34
##   1957       32
##   1958       26
##   1959       42
##   1960       39
##   1961       50
##   1962       49
##   1963       44
##   1964       56
##   1965       36
##   1966       36
##   1967       26
##   1968       40
##   1969       29
##   1970       17
##   1971       13
##   1972       19
##   1973       16
##   1974       26
##   1975       19
##   1976       26
##   1977       57
##   1978       13
##   1979       23
##   1980       10
##   1981       27
##   1982       13
##   1983       13
##   1984       31
##   1985       15
##   1986       12
##   1987       24
##   1988       11
##   1989       12
##   1990        5
##   1991        9
##   1992        9
##   1993        6
##   1994        9
##   1995        5
##   1996        6
##   1997       10
##   1998        4
##   1999        3
##   2000       10
##   2001        8
##   2002        7
##   2003        5
##   2004        6
##   2005       19
##   2006        6
##   2007        4
##   2008       22
##   2009        6
##   2010        4
##   2011       11
##   2012        5
##   2013       13
##   2014        7
##   2015        6
##   2016        2
##   2017        2
##   NA          5
  1. Em que ano foi adquirida a primeira pintura de uma artista feminina (solo)? Quando essa pintura foi criada? Qual artista? Qual título?

R: Em 1937 foi adquirida a primeira pintura de uma artista feminina solo. Essa pintura foi criada em 1931. Trata-se da obra Family Portrait, II. A artista dessa obra é Florine Stettheimer.

table(arte_MOMA$year_acquired,arte_MOMA$artist_gender)
##       
##        Não Sim
##   1930   0   2
##   1931   0   2
##   1932   0   1
##   1934   0  14
##   1935   1  21
##   1936   2  16
##   1937   2  17
##   1938   1   7
##   1939   2  29
##   1940   3  15
##   1941   3  36
##   1942   9  62
##   1943   0  22
##   1944   2  15
##   1945   3  12
##   1946   1   4
##   1947   2  12
##   1948   2   9
##   1949   2  27
##   1950   1  22
##   1951   2  25
##   1952   2  18
##   1953   1  21
##   1954   1  29
##   1955   0  36
##   1956   5  37
##   1957   0  18
##   1958   3  36
##   1959   0  37
##   1960   2  32
##   1961   2  43
##   1962   1  20
##   1963   4  29
##   1964   3  33
##   1965   7  31
##   1966   0  23
##   1967   9  56
##   1968   3  17
##   1969   2  43
##   1970   5  32
##   1971   1  27
##   1972   1   6
##   1973   6  10
##   1974   0  11
##   1975   1  23
##   1976   1  18
##   1977   1  16
##   1978   3  18
##   1979   7  64
##   1980   1  19
##   1981   1  22
##   1982   1  19
##   1983   1  29
##   1984   0  15
##   1985   2  84
##   1986   0  15
##   1987   1  10
##   1988   0   8
##   1989   0   7
##   1990   1  25
##   1991   3  64
##   1992   3  27
##   1993   2   5
##   1994   7  34
##   1995   1  12
##   1996   4  29
##   1997   1  20
##   1998   3  23
##   1999   2  22
##   2000   7  22
##   2001   3   8
##   2002  14  11
##   2003   0   4
##   2004   6  21
##   2005  12  55
##   2006   7  14
##   2007   0  13
##   2008   9  46
##   2009   6  15
##   2010   4  14
##   2011   7  20
##   2012   9  18
##   2013   5  17
##   2014   0  20
##   2015   4  17
##   2016   7  26
##   2017   8   9
##   NA     4   5
table(arte_MOMA$year_created,arte_MOMA$classification)
##       
##        Painting
##   1872        1
##   1875        6
##   1879        2
##   1882        1
##   1883        2
##   1885        2
##   1886        1
##   1887        2
##   1888        4
##   1889        5
##   1890        2
##   1891        1
##   1892        2
##   1893        3
##   1894        2
##   1895        3
##   1896        1
##   1897        2
##   1898        1
##   1899        2
##   1900        6
##   1901        1
##   1902        2
##   1903        1
##   1904        1
##   1905       11
##   1906        6
##   1907       15
##   1908       14
##   1909       12
##   1910       18
##   1911       19
##   1912       33
##   1913       21
##   1914       37
##   1915       18
##   1916       11
##   1917       14
##   1918       13
##   1919        9
##   1920       11
##   1921       13
##   1922       13
##   1923       11
##   1924       14
##   1925       25
##   1926       23
##   1927       27
##   1928       32
##   1929       22
##   1930       21
##   1931       13
##   1932       21
##   1933       13
##   1934       13
##   1935       16
##   1936       15
##   1937       18
##   1938       24
##   1939       26
##   1940       56
##   1941       24
##   1942       31
##   1943       18
##   1944       28
##   1945       13
##   1946       22
##   1947       18
##   1948       25
##   1949       32
##   1950       37
##   1951       16
##   1952       27
##   1953       27
##   1954       23
##   1955       28
##   1956       34
##   1957       32
##   1958       26
##   1959       42
##   1960       39
##   1961       50
##   1962       49
##   1963       44
##   1964       56
##   1965       36
##   1966       36
##   1967       26
##   1968       40
##   1969       29
##   1970       17
##   1971       13
##   1972       19
##   1973       16
##   1974       26
##   1975       19
##   1976       26
##   1977       57
##   1978       13
##   1979       23
##   1980       10
##   1981       27
##   1982       13
##   1983       13
##   1984       31
##   1985       15
##   1986       12
##   1987       24
##   1988       11
##   1989       12
##   1990        5
##   1991        9
##   1992        9
##   1993        6
##   1994        9
##   1995        5
##   1996        6
##   1997       10
##   1998        4
##   1999        3
##   2000       10
##   2001        8
##   2002        7
##   2003        5
##   2004        6
##   2005       19
##   2006        6
##   2007        4
##   2008       22
##   2009        6
##   2010        4
##   2011       11
##   2012        5
##   2013       13
##   2014        7
##   2015        6
##   2016        2
##   2017        2
##   NA          5
  1. Qual o artista ficou mais tempo vivo?

R: A maior idade que um artista atingiu foi de 102 anos.Essa artista foi Dorothea Tanning.

summary(arte_MOMA$age)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##      27      67      77      75      85     102     629
table(arte_MOMA$age)
## 
##  27  28  29  30  31  32  34  35  36  37  38  39  40  41  42  43  44  45  46  47 
##   2   1   1   2   1   5  15   4   6   4   3   1   7   4   1   2  31   1   1   9 
##  48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67 
##   6   1  12  14  18   3  23  18  10  12   9  28   3  18   8  11  15  31  34  72 
##  68  69  70  71  72  73  74  75  76  77  78  79  80  81  82  83  84  85  86  87 
##  19  33  20  33  46  29  77  39  64  30  48  27  46  31  30  84  46  82  73  24 
##  88  89  90  91  92  93  94  95  96  97  98  99 101 102 
##  28  33  50  27  88  21  15   5  10   2   7   6   3   1
table(arte_MOMA$age,arte_MOMA$n_female_artists)
##      
##        0  1  2
##   27   2  0  0
##   28   1  0  0
##   29   1  0  0
##   30   2  0  0
##   31   0  1  0
##   32   4  1  0
##   34  12  3  0
##   35   2  2  0
##   36   6  0  0
##   37   4  0  0
##   38   3  0  0
##   39   1  0  0
##   40   7  0  0
##   41   3  1  0
##   42   1  0  0
##   43   2  0  0
##   44  31  0  0
##   45   1  0  0
##   46   1  0  0
##   47   6  3  0
##   48   6  0  0
##   49   0  1  0
##   50  11  1  0
##   51  14  0  0
##   52  15  3  0
##   53   3  0  0
##   54  20  3  0
##   55  17  1  0
##   56  10  0  0
##   57  12  0  0
##   58   9  0  0
##   59  28  0  0
##   60   3  0  0
##   61  18  0  0
##   62   7  1  0
##   63   8  3  0
##   64  12  3  0
##   65  29  2  0
##   66  34  0  0
##   67  55 17  0
##   68  15  4  0
##   69  29  4  0
##   70  20  0  0
##   71  33  0  0
##   72  43  3  0
##   73  23  6  0
##   74  75  2  0
##   75  38  1  0
##   76  61  3  0
##   77  30  0  0
##   78  47  1  0
##   79  27  0  0
##   80  45  1  0
##   81  28  3  0
##   82  29  1  0
##   83  79  5  0
##   84  41  5  0
##   85  81  1  0
##   86  68  5  0
##   87  22  2  0
##   88  26  2  0
##   89  25  8  0
##   90  50  0  0
##   91  26  1  0
##   92  79  9  0
##   93  20  1  0
##   94  13  2  0
##   95   4  1  0
##   96   8  2  0
##   97   2  0  0
##   98   7  0  0
##   99   2  4  0
##   101  2  1  0
##   102  0  1  0
table(arte_MOMA$age,arte_MOMA$n_male_artists)
##      
##        0  1  2  3  9
##   27   0  2  0  0  0
##   28   0  1  0  0  0
##   29   0  1  0  0  0
##   30   0  2  0  0  0
##   31   1  0  0  0  0
##   32   1  4  0  0  0
##   34   3 12  0  0  0
##   35   2  2  0  0  0
##   36   0  6  0  0  0
##   37   0  4  0  0  0
##   38   0  3  0  0  0
##   39   0  1  0  0  0
##   40   0  7  0  0  0
##   41   1  3  0  0  0
##   42   0  1  0  0  0
##   43   0  2  0  0  0
##   44   0 31  0  0  0
##   45   0  1  0  0  0
##   46   0  1  0  0  0
##   47   3  6  0  0  0
##   48   0  6  0  0  0
##   49   1  0  0  0  0
##   50   1 11  0  0  0
##   51   0 14  0  0  0
##   52   3 15  0  0  0
##   53   0  3  0  0  0
##   54   3 20  0  0  0
##   55   1 17  0  0  0
##   56   0 10  0  0  0
##   57   0 12  0  0  0
##   58   0  9  0  0  0
##   59   0 28  0  0  0
##   60   0  3  0  0  0
##   61   0 18  0  0  0
##   62   0  7  0  0  1
##   63   3  8  0  0  0
##   64   3 12  0  0  0
##   65   2 29  0  0  0
##   66   0 34  0  0  0
##   67  17 55  0  0  0
##   68   3 16  0  0  0
##   69   4 29  0  0  0
##   70   0 20  0  0  0
##   71   0 33  0  0  0
##   72   3 43  0  0  0
##   73   6 23  0  0  0
##   74   2 75  0  0  0
##   75   1 38  0  0  0
##   76   3 61  0  0  0
##   77   0 30  0  0  0
##   78   1 47  0  0  0
##   79   0 27  0  0  0
##   80   1 45  0  0  0
##   81   3 28  0  0  0
##   82   1 29  0  0  0
##   83   5 79  0  0  0
##   84   5 41  0  0  0
##   85   1 81  0  0  0
##   86   5 67  1  0  0
##   87   2 22  0  0  0
##   88   2 26  0  0  0
##   89   8 25  0  0  0
##   90   0 50  0  0  0
##   91   1 26  0  0  0
##   92   9 79  0  0  0
##   93   1 20  0  0  0
##   94   2 13  0  0  0
##   95   1  4  0  0  0
##   96   2  8  0  0  0
##   97   0  2  0  0  0
##   98   0  7  0  0  0
##   99   4  2  0  0  0
##   101  1  2  0  0  0
##   102  1  0  0  0  0
  1. Qual a idade média de um artista?

R: A média de idade de um artista é de aproximadamente 75 anos.

summary(arte_MOMA)
##       ...1         title            artist         artist_bio       
##  Min.   :   1   Length:2253        Mode:logical   Length:2253       
##  1st Qu.: 564   Class :character   NA's:2253      Class :character  
##  Median :1127   Mode  :character                  Mode  :character  
##  Mean   :1127                                                       
##  3rd Qu.:1690                                                       
##  Max.   :2253                                                       
##                                                                     
##  artist_birth_year  artist_death_year       age      num_artists       
##  Length:2253        Length:2253        Min.   : 27   Length:2253       
##  Class :character   Class :character   1st Qu.: 67   Class :character  
##  Mode  :character   Mode  :character   Median : 77   Mode  :character  
##                                        Mean   : 75                     
##                                        3rd Qu.: 85                     
##                                        Max.   :102                     
##                                        NA's   :629                     
##  n_female_artists n_male_artists artist_gender      year_acquired     
##  Min.   :0.00     Min.   :0.0    Length:2253        Length:2253       
##  1st Qu.:0.00     1st Qu.:1.0    Class :character   Class :character  
##  Median :0.00     Median :1.0    Mode  :character   Mode  :character  
##  Mean   :0.11     Mean   :0.9                                         
##  3rd Qu.:0.00     3rd Qu.:1.0                                         
##  Max.   :2.00     Max.   :9.0                                         
##                                                                       
##  year_created       circumference_cm     depth_cm         diameter_cm       
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##    height_cm     length_cm            width_cm    seat_height_cm    
##  Min.   :   7   Length:2253        Min.   :   4   Length:2253       
##  1st Qu.:  61   Class :character   1st Qu.:  61   Class :character  
##  Median : 107   Mode  :character   Median :  99   Mode  :character  
##  Mean   : 124                      Mean   : 132                     
##  3rd Qu.: 182                      3rd Qu.: 170                     
##  Max.   :1011                      Max.   :4663                     
##                                                                     
##    purchase             gift             exchange         classification    
##  Length:2253        Length:2253        Length:2253        Length:2253       
##  Class :character   Class :character   Class :character   Class :character  
##  Mode  :character   Mode  :character   Mode  :character   Mode  :character  
##                                                                             
##                                                                             
##                                                                             
##                                                                             
##   department       
##  Length:2253       
##  Class :character  
##  Mode  :character  
##                    
##                    
##                    
## 
  1. Artistas homens vivem mais do que as mulheres?

R: 499 artistas homens viveram entre 80 e 90 anos de idade. R: 289 artistas mulheres viveram entre 80 e 90 anos de idade. Portanto, os artistas homens atingem idades mais avançadas do que as mulheres da mesma categoria.

table(arte_MOMA$age,arte_MOMA$n_female_artists)
##      
##        0  1  2
##   27   2  0  0
##   28   1  0  0
##   29   1  0  0
##   30   2  0  0
##   31   0  1  0
##   32   4  1  0
##   34  12  3  0
##   35   2  2  0
##   36   6  0  0
##   37   4  0  0
##   38   3  0  0
##   39   1  0  0
##   40   7  0  0
##   41   3  1  0
##   42   1  0  0
##   43   2  0  0
##   44  31  0  0
##   45   1  0  0
##   46   1  0  0
##   47   6  3  0
##   48   6  0  0
##   49   0  1  0
##   50  11  1  0
##   51  14  0  0
##   52  15  3  0
##   53   3  0  0
##   54  20  3  0
##   55  17  1  0
##   56  10  0  0
##   57  12  0  0
##   58   9  0  0
##   59  28  0  0
##   60   3  0  0
##   61  18  0  0
##   62   7  1  0
##   63   8  3  0
##   64  12  3  0
##   65  29  2  0
##   66  34  0  0
##   67  55 17  0
##   68  15  4  0
##   69  29  4  0
##   70  20  0  0
##   71  33  0  0
##   72  43  3  0
##   73  23  6  0
##   74  75  2  0
##   75  38  1  0
##   76  61  3  0
##   77  30  0  0
##   78  47  1  0
##   79  27  0  0
##   80  45  1  0
##   81  28  3  0
##   82  29  1  0
##   83  79  5  0
##   84  41  5  0
##   85  81  1  0
##   86  68  5  0
##   87  22  2  0
##   88  26  2  0
##   89  25  8  0
##   90  50  0  0
##   91  26  1  0
##   92  79  9  0
##   93  20  1  0
##   94  13  2  0
##   95   4  1  0
##   96   8  2  0
##   97   2  0  0
##   98   7  0  0
##   99   2  4  0
##   101  2  1  0
##   102  0  1  0
table(arte_MOMA$age,arte_MOMA$n_male_artists)
##      
##        0  1  2  3  9
##   27   0  2  0  0  0
##   28   0  1  0  0  0
##   29   0  1  0  0  0
##   30   0  2  0  0  0
##   31   1  0  0  0  0
##   32   1  4  0  0  0
##   34   3 12  0  0  0
##   35   2  2  0  0  0
##   36   0  6  0  0  0
##   37   0  4  0  0  0
##   38   0  3  0  0  0
##   39   0  1  0  0  0
##   40   0  7  0  0  0
##   41   1  3  0  0  0
##   42   0  1  0  0  0
##   43   0  2  0  0  0
##   44   0 31  0  0  0
##   45   0  1  0  0  0
##   46   0  1  0  0  0
##   47   3  6  0  0  0
##   48   0  6  0  0  0
##   49   1  0  0  0  0
##   50   1 11  0  0  0
##   51   0 14  0  0  0
##   52   3 15  0  0  0
##   53   0  3  0  0  0
##   54   3 20  0  0  0
##   55   1 17  0  0  0
##   56   0 10  0  0  0
##   57   0 12  0  0  0
##   58   0  9  0  0  0
##   59   0 28  0  0  0
##   60   0  3  0  0  0
##   61   0 18  0  0  0
##   62   0  7  0  0  1
##   63   3  8  0  0  0
##   64   3 12  0  0  0
##   65   2 29  0  0  0
##   66   0 34  0  0  0
##   67  17 55  0  0  0
##   68   3 16  0  0  0
##   69   4 29  0  0  0
##   70   0 20  0  0  0
##   71   0 33  0  0  0
##   72   3 43  0  0  0
##   73   6 23  0  0  0
##   74   2 75  0  0  0
##   75   1 38  0  0  0
##   76   3 61  0  0  0
##   77   0 30  0  0  0
##   78   1 47  0  0  0
##   79   0 27  0  0  0
##   80   1 45  0  0  0
##   81   3 28  0  0  0
##   82   1 29  0  0  0
##   83   5 79  0  0  0
##   84   5 41  0  0  0
##   85   1 81  0  0  0
##   86   5 67  1  0  0
##   87   2 22  0  0  0
##   88   2 26  0  0  0
##   89   8 25  0  0  0
##   90   0 50  0  0  0
##   91   1 26  0  0  0
##   92   9 79  0  0  0
##   93   1 20  0  0  0
##   94   2 13  0  0  0
##   95   1  4  0  0  0
##   96   2  8  0  0  0
##   97   0  2  0  0  0
##   98   0  7  0  0  0
##   99   4  2  0  0  0
##   101  1  2  0  0  0
##   102  1  0  0  0  0

Passo 5: Recriando o diagrama de dispersão do fivethirtyeight chamado MoMA Paintings:

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.0.4
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
arte_MOMA <- arte_MOMA %>% 
  filter(height_cm < 600, width_cm < 760) %>% 
  mutate(hw_ratio = height_cm / width_cm,
         hw_cat = case_when(
           hw_ratio > 1 ~ "mais alto que largo",
           hw_ratio < 1 ~ "mais largo que alto",
           hw_ratio == 1 ~ "quadrado perfeito"
         ))
library(ggthemes)
## Warning: package 'ggthemes' was built under R version 4.0.4
ggplot(arte_MOMA, aes(x = width_cm, y = height_cm, colour = hw_cat)) +
  geom_point(alpha = .5) +
  ggtitle("Pinturas do MoMA, altas e largas") +
  scale_colour_manual(name = "",
                      values = c("gray50", "#FF9900", "#B14CF0")) +
  theme_fivethirtyeight() +
  theme(axis.title = element_text()) +
  labs(x = "Largura", y = "Altura")