# Carregar os pacotes
library( dplyr)
library( ggplot2)
# Criando um dataframe simples
dados <- tibble(
x = 1 : 10 ,
y = rnorm( 10 )
)
# Manipulando dados com dplyr (aqui só estamos filtrando os dados, mas você pode fazer mais)
dados_filtrados <- dados %>%
filter( x > 5 )
# Exibindo os dados filtrados
print( dados_filtrados)
# Criando um gráfico com ggplot2
ggplot( dados_filtrados, aes( x = x, y = y) ) +
geom_point( ) +
ggtitle( "Gráfico de Exemplo: Olá Mundo!" ) +
theme_minimal( )
# Imprimindo uma mensagem
print( "Olá Mundo" )
IyBDYXJyZWdhciBvcyBwYWNvdGVzCmxpYnJhcnkoZHBseXIpCmxpYnJhcnkoZ2dwbG90MikKCiMgQ3JpYW5kbyB1bSBkYXRhZnJhbWUgc2ltcGxlcwpkYWRvcyA8LSB0aWJibGUoCiAgeCA9IDE6MTAsCiAgeSA9IHJub3JtKDEwKQopCgojIE1hbmlwdWxhbmRvIGRhZG9zIGNvbSBkcGx5ciAoYXF1aSBzw7MgZXN0YW1vcyBmaWx0cmFuZG8gb3MgZGFkb3MsIG1hcyB2b2PDqiBwb2RlIGZhemVyIG1haXMpCmRhZG9zX2ZpbHRyYWRvcyA8LSBkYWRvcyAlPiUgCiAgZmlsdGVyKHggPiA1KQoKIyBFeGliaW5kbyBvcyBkYWRvcyBmaWx0cmFkb3MKcHJpbnQoZGFkb3NfZmlsdHJhZG9zKQoKIyBDcmlhbmRvIHVtIGdyw6FmaWNvIGNvbSBnZ3Bsb3QyCmdncGxvdChkYWRvc19maWx0cmFkb3MsIGFlcyh4ID0geCwgeSA9IHkpKSArCiAgZ2VvbV9wb2ludCgpICsKICBnZ3RpdGxlKCJHcsOhZmljbyBkZSBFeGVtcGxvOiBPbMOhIE11bmRvISIpICsKICB0aGVtZV9taW5pbWFsKCkKCiMgSW1wcmltaW5kbyB1bWEgbWVuc2FnZW0KcHJpbnQoIk9sw6EgTXVuZG8iKQo=
stdout
# A tibble: 5 × 2
x y
<int> <dbl>
1 6 0.2191121
2 7 -0.1309253
3 8 -1.6984721
4 9 1.6731588
5 10 -0.5046439
[1] "Olá Mundo"
stderr
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