vdr_run_chunks <- as.logical(Sys.getenv("vdr_run_chunks")) knitr::opts_chunk$set(eval = vdr_run_chunks)
Em um novo script do R, crie um vetor de valores aleatórios da distribuição Normal com o comando rnorm(N)
, onde N é igual a 100. Agora, crie um gráfico de pontos onde o eixo y é representado pela série anterior, e o eixo x é simplesmente a contagem dos valores (1..100). Para este gráfico, utilize o template básico do ggplot2
, isto é, não precisas modificar nenhum elemento textual do gráfico, por enquanto.
require(ggplot2) N <- 100 vec <- rnorm(N) df <- dplyr::tibble( y = vec, x = 1:N ) p <- ggplot(df, aes(x = x, y = y)) + geom_point() p
extype: string
exsolution: r mchoice2string(c(TRUE, FALSE, FALSE, FALSE, FALSE), single = TRUE)
exname: "ggplot 01"
exshuffle: TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.