library(readr)
## Warning: package 'readr' was built under R version 4.0.4
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.0.4
##
## 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
Banco_Moma <- read_delim("C:/Users/eduma/Base_de_dados-master/arte_MOMA.csv",
";", escape_double = FALSE, trim_ws = TRUE)
## Warning: Missing column names filled in: 'X1' [1]
##
## -- Column specification --------------------------------------------------------
## cols(
## .default = col_double(),
## title = col_character(),
## artist = col_character(),
## artist_bio = col_character(),
## artist_gender = col_character(),
## 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()
## )
## i Use `spec()` for the full column specifications.
summary(Banco_Moma$year_acquired)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1930 1957 1975 1976 1996 2017 9
Banco_Moma$year_acquired_primeira <- ifelse(Banco_Moma$year_acquired=="1930", "primeira","Outro")
tabelaprimeira<- table(Banco_Moma$year_acquired_primeira)
tabelaprimeira
##
## Outro primeira
## 2242 2
Banco_Moma %>%
filter(year_acquired_primeira == "primeira") %>%
pull(artist) %>%
first()
## [1] "Edward Hopper"
Banco_Moma %>%
filter(year_acquired_primeira == "primeira") %>%
pull(title) %>%
first()
## [1] "House by the Railroad"
Banco_Moma %>%
filter(year_acquired_primeira == "primeira") %>%
pull(artist) %>%
last()
## [1] "Bernard Karfiol"
Banco_Moma %>%
filter(year_acquired_primeira == "primeira") %>%
pull(title) %>%
last()
## [1] "Seated Nude"
summary(Banco_Moma$year_created)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 1872 1933 1956 1954 1972 2017 5
Banco_Moma$year_created_antiga <- ifelse(Banco_Moma$year_created=="1872", "Mais_Antiga","Outro")
tabelaantiga<-table(Banco_Moma$year_created_antiga)
tabelaantiga
##
## Mais_Antiga Outro
## 1 2247
Banco_Moma %>%
filter(year_created_antiga == "Mais_Antiga") %>%
pull(title) %>%
first()
## [1] "Landscape at Daybreak"
Banco_Moma %>%
filter(year_created_antiga == "Mais_Antiga") %>%
pull(artist) %>%
first()
## [1] "Odilon Redon"
class(Banco_Moma$artist)
## [1] "character"
Banco_Moma$artist<- as.factor(Banco_Moma$artist)
str(Banco_Moma$artist)
## Factor w/ 989 levels "\"Edward C. (\"\"Pa\"\") Hunt\"",..: 455 728 728 712 98 280 135 752 723 245 ...
head(Banco_Moma$artist)
## [1] Joan Mir<f3> Paul Klee Paul Klee Pablo Picasso
## [5] Arthur Dove Francis Picabia
## 989 Levels: "Edward C. (""Pa"") Hunt" \xc9douard Vuillard ... Zvi Gali
summary(Banco_Moma$artist)
## Pablo Picasso Henri Matisse
## 55 32
## On Kawara Jacob Lawrence
## 32 30
## Batiste Madalena Jean Dubuffet
## 25 25
## Odilon Redon Ben Vautier
## 25 24
## Frank Stella Philip Guston
## 23 23
## Joan Mir<f3> Jackson Pollock
## 19 18
## Gerhard Richter Piet Mondrian
## 17 16
## Andy Warhol Fernand L<e9>ger
## 15 15
## Giorgio de Chirico Paul Klee
## 14 14
## Richard Pettibone Ellsworth Kelly
## 13 12
## Jasper Johns Sherrie Levine
## 12 12
## Yves Tanguy Ad Reinhardt
## 11 10
## Andr<e9> Derain Mark Rothko
## 10 10
## Adolph Gottlieb Agnes Martin
## 9 9
## Andr<e9> Masson Francis Picabia
## 9 9
## Georges Braque Max Ernst
## 9 9
## Paul C<e9>zanne Robert Motherwell
## 9 9
## Robert Rauschenberg Robert Ryman
## 9 9
## Roy Lichtenstein Arshile Gorky
## 9 8
## Elizabeth Murray L<e1>szl<f3> Moholy-Nagy
## 8 8
## Marcel Duchamp Morris Hirshfield
## 8 8
## Susan Rothenberg Willem de Kooning
## 8 8
## Al Held Alex Katz
## 7 7
## Barnett Newman Brice Marden
## 7 7
## Edward Ruscha Joaqu<ed>n Torres-Garc<ed>a
## 7 7
## Josef Albers Kazimir Malevich
## 7 7
## Marcel Broodthaers Ren<e9> Magritte
## 7 7
## Richard Artschwager Sigmar Polke
## 7 7
## Tom Wesselmann Umberto Boccioni
## 7 7
## Vasily Kandinsky Alfred Jensen
## 7 6
## Cy Twombly David Alfaro Siqueiros
## 6 6
## Jake Berthot Joan Mitchell
## 6 6
## John Walker Josh Smith
## 6 6
## Juan Gris Loren MacIver
## 6 6
## R. H. Quaytman Roberto Matta
## 6 6
## Stuart Davis Alberto Giacometti
## 6 5
## Anselm Kiefer Chuck Close
## 5 5
## Claude Monet Eugene Berman
## 5 5
## Francis Bacon Frantisek Kupka
## 5 5
## Franz Kline Hans Hofmann
## 5 5
## Helen Frankenthaler Jacques Villon
## 5 5
## James Rosenquist Jim Dine
## 5 5
## John Kane Larry Rivers
## 5 5
## Luc Tuymans Lyonel Feininger
## 5 5
## Neil Jenney Peter Blume
## 5 5
## Pierre Bonnard Richard Pousette-Dart
## 5 5
## <c9>douard Vuillard Auguste Herbin
## 4 4
## Balthus (Baltusz Klossowski de Rola) Ben Nicholson
## 4 4
## Bradley Walker Tomlin Chaim Soutine
## 4 4
## Daniel Buren (Other)
## 4 1276
Banco_Moma$artist_gender<-as.factor(Banco_Moma$artist_gender)
class(Banco_Moma$artist_gender)
## [1] "factor"
table(Banco_Moma$classification,Banco_Moma$artist_gender)
##
## Female Male
## Painting 252 1991
table(Banco_Moma$n_female_artists,Banco_Moma$n_male_artists)
##
## 0 1 2 3 9
## 0 1 1991 2 4 0
## 1 252 1 0 0 1
## 2 1 0 0 0 0
table(Banco_Moma$classification,Banco_Moma$year_acquired)
##
## 1930 1931 1932 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943
## Painting 2 2 1 14 22 18 19 8 31 18 39 71 22
##
## 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956
## Painting 17 15 5 14 11 29 23 27 20 22 30 36 42
##
## 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969
## Painting 18 39 37 34 45 21 33 36 38 23 65 20 45
##
## 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982
## Painting 37 28 7 16 11 24 19 17 21 71 20 23 20
##
## 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995
## Painting 30 15 86 15 11 8 7 26 67 30 7 41 13
##
## 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008
## Painting 33 21 26 24 29 11 25 4 27 67 21 13 55
##
## 2009 2010 2011 2012 2013 2014 2015 2016 2017
## Painting 21 18 27 27 22 20 21 33 17
table(Banco_Moma$classification,Banco_Moma$year_created)
##
## 1872 1875 1879 1882 1883 1885 1886 1887 1888 1889 1890 1891 1892
## Painting 1 6 2 1 2 2 1 2 4 5 2 1 2
##
## 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905
## Painting 3 2 3 1 2 1 2 6 1 2 1 1 11
##
## 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918
## Painting 6 15 14 12 18 19 33 21 37 18 11 14 13
##
## 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931
## Painting 9 11 13 13 11 14 25 23 27 32 22 21 13
##
## 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944
## Painting 21 13 13 16 15 18 24 26 56 24 31 18 28
##
## 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957
## Painting 13 22 18 25 32 37 16 27 27 23 28 34 32
##
## 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970
## Painting 26 42 39 50 49 44 56 36 36 26 40 29 17
##
## 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983
## Painting 13 19 16 26 19 26 57 13 23 10 27 13 13
##
## 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996
## Painting 31 15 12 24 11 12 5 9 9 6 9 5 6
##
## 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
## Painting 10 4 3 10 8 7 5 6 19 6 4 22 6
##
## 2010 2011 2012 2013 2014 2015 2016 2017
## Painting 4 11 5 13 7 6 2 2
table(Banco_Moma$year_acquired,Banco_Moma$n_female_artists)
##
## 0 1 2
## 1930 2 0 0
## 1931 2 0 0
## 1932 1 0 0
## 1934 14 0 0
## 1935 22 0 0
## 1936 18 0 0
## 1937 18 1 0
## 1938 7 1 0
## 1939 31 0 0
## 1940 17 1 0
## 1941 37 2 0
## 1942 67 4 0
## 1943 21 1 0
## 1944 14 3 0
## 1945 13 2 0
## 1946 5 0 0
## 1947 13 1 0
## 1948 11 0 0
## 1949 28 1 0
## 1950 22 1 0
## 1951 26 1 0
## 1952 20 0 0
## 1953 21 1 0
## 1954 26 4 0
## 1955 32 4 0
## 1956 39 3 0
## 1957 18 0 0
## 1958 37 2 0
## 1959 37 0 0
## 1960 29 5 0
## 1961 41 4 0
## 1962 20 1 0
## 1963 32 1 0
## 1964 32 4 0
## 1965 34 4 0
## 1966 22 1 0
## 1967 65 0 0
## 1968 17 3 0
## 1969 40 5 0
## 1970 34 3 0
## 1971 25 3 0
## 1972 7 0 0
## 1973 16 0 0
## 1974 10 1 0
## 1975 23 1 0
## 1976 17 2 0
## 1977 15 2 0
## 1978 21 0 0
## 1979 64 7 0
## 1980 19 1 0
## 1981 22 1 0
## 1982 18 2 0
## 1983 24 6 0
## 1984 12 3 0
## 1985 77 9 0
## 1986 13 2 0
## 1987 7 4 0
## 1988 4 4 0
## 1989 6 1 0
## 1990 23 3 0
## 1991 62 5 0
## 1992 27 3 0
## 1993 7 0 0
## 1994 32 9 0
## 1995 12 1 0
## 1996 31 2 0
## 1997 16 5 0
## 1998 25 1 0
## 1999 24 0 0
## 2000 28 1 0
## 2001 9 2 0
## 2002 18 7 0
## 2003 4 0 0
## 2004 11 16 0
## 2005 52 15 0
## 2006 18 3 0
## 2007 9 4 0
## 2008 49 6 0
## 2009 12 9 0
## 2010 13 5 0
## 2011 22 4 1
## 2012 24 3 0
## 2013 15 7 0
## 2014 13 7 0
## 2015 14 7 0
## 2016 26 7 0
## 2017 8 9 0
Banco_Moma[333:333,c("year_created","artist","title","year_acquired")]
## # A tibble: 1 x 4
## year_created artist title year_acquired
## <dbl> <fct> <chr> <dbl>
## 1 1912 Natalia Goncharova Landscape, 47 1937
Banco_Moma$idade<-Banco_Moma$artist_death_year - Banco_Moma$artist_birth_year
summary(Banco_Moma$idade)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 27.00 67.00 77.00 74.66 85.00 102.00 629
table(Banco_Moma$idade=="102")
##
## FALSE TRUE
## 1623 1
Banco_Moma %>%
filter(Banco_Moma$idade=="102") %>%
pull(artist) %>%
first()
## [1] Dorothea Tanning
## 989 Levels: "Edward C. (""Pa"") Hunt" \xc9douard Vuillard ... Zvi Gali
summary(Banco_Moma$idade)
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
## 27.00 67.00 77.00 74.66 85.00 102.00 629
table(Banco_Moma$idade,Banco_Moma$artist_gender)
##
## Female Male
## 27 0 2
## 28 0 1
## 29 0 1
## 30 0 2
## 31 1 0
## 32 1 4
## 34 3 12
## 35 2 2
## 36 0 6
## 37 0 4
## 38 0 3
## 39 0 1
## 40 0 7
## 41 1 3
## 42 0 1
## 43 0 2
## 44 0 31
## 45 0 1
## 46 0 1
## 47 3 6
## 48 0 6
## 49 1 0
## 50 1 11
## 51 0 14
## 52 3 15
## 53 0 3
## 54 3 20
## 55 1 17
## 56 0 10
## 57 0 12
## 58 0 9
## 59 0 28
## 60 0 3
## 61 0 18
## 62 0 7
## 63 3 8
## 64 3 12
## 65 2 29
## 66 0 34
## 67 17 55
## 68 3 15
## 69 4 29
## 70 0 20
## 71 0 33
## 72 3 43
## 73 6 23
## 74 2 75
## 75 1 38
## 76 3 61
## 77 0 30
## 78 1 47
## 79 0 27
## 80 1 45
## 81 3 28
## 82 1 29
## 83 5 79
## 84 5 41
## 85 1 81
## 86 5 67
## 87 2 22
## 88 2 26
## 89 8 25
## 90 0 50
## 91 1 26
## 92 9 79
## 93 1 20
## 94 2 13
## 95 1 4
## 96 2 8
## 97 0 2
## 98 0 7
## 99 4 2
## 101 1 2
## 102 1 0
library(ggplot2)
moma_dim <- Banco_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(moma_dim, 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")