-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
212 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
^_pkgdown\.yml$ | ||
^docs$ | ||
^pkgdown$ | ||
^Meta$ | ||
^img$ | ||
^\.github$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# | ||
# See https://github.com/r-lib/actions/tree/master/examples#readme for | ||
# additional example workflows available for the R community. | ||
|
||
name: R | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
strategy: | ||
matrix: | ||
r-version: [3.5, 3.6] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up R ${{ matrix.r-version }} | ||
uses: r-lib/actions/setup-r@ffe45a39586f073cc2e9af79c4ba563b657dc6e3 | ||
with: | ||
r-version: ${{ matrix.r-version }} | ||
- name: Install dependencies | ||
run: | | ||
install.packages(c("remotes", "rcmdcheck")) | ||
remotes::install_deps(dependencies = TRUE) | ||
shell: Rscript {0} | ||
- name: Check | ||
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error") | ||
shell: Rscript {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,5 @@ inst/doc | |
.Rproj.user | ||
|
||
*.DS_Store | ||
doc | ||
Meta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,6 @@ Depends: | |
R (>= 4.0.0) | ||
VignetteBuilder: knitr | ||
Imports: | ||
gradethis, | ||
learnr, | ||
rsconnect, | ||
ggplot2, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
import(learnr) | ||
import(dplyr) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,98 @@ | ||
#' Listar los tutoriales disponibles en el paquete | ||
#' @import dplyr | ||
NULL | ||
|
||
#' @title Practicar con tutorial | ||
#' | ||
#' @description Despliega el tutorial elegido por su nombre en un navegador web | ||
#' | ||
#' @details La función necesita que en el computador docker esté instalado y que | ||
#' se hayan agregado las lineas siguientes en la terminal: | ||
#' | ||
#' @param nombre_tutorial Es el nombre de uno de los tutoriales dentro del | ||
#' paquete ixpantia.introR | ||
#' | ||
#' @examples | ||
#'\dontrun{ | ||
#' practicar("pizarra_coercion") | ||
#'} | ||
practicar <- function(nombre_tutorial) { | ||
tutoriales <- available_tutorials("ixpantia.introR") %>% | ||
as_tibble() | ||
|
||
nombres <- tutoriales %>% | ||
select(name) %>% | ||
pull() | ||
|
||
if (!nombre_tutorial %in% nombres) { | ||
nombres <- tutoriales %>% | ||
select(name) %>% | ||
pull() | ||
print("Nombre no válido. Elegir alguno de los siguientes:") | ||
nombres | ||
} | ||
|
||
learnr::run_tutorial(nombre_tutorial, package = "ixpantia.introR") | ||
} | ||
|
||
#' @title Listar tutoriales | ||
#' | ||
#' @description Genera una lista con los tutoriales disponibles en el paquete. | ||
#' | ||
#' @details La función permitar dar una lista de los tutoriales disponibles en | ||
#' el paquete por su tipo, ya sea tarea o pizarra. | ||
#' | ||
#' @import learnr | ||
#' @return lista Lista de tutoriales | ||
lista_tutoriales <- function() { | ||
#' @param tipo Es el tipo del tutorial que queremos listar. Puede ser `tarea` o | ||
#' `pizarra` | ||
#' | ||
#' @examples | ||
#'\dontrun{ | ||
#' listar_tutoriales(tipo = "pizarra") | ||
#'} | ||
listar_tutoriales <- function(tipo) { | ||
|
||
if (is.null(tipo)) { | ||
"Por favor indique el tipo del tutorial" | ||
} | ||
|
||
if (tipo == "tarea") { | ||
tutoriales <- learnr::available_tutorials("ixpantia.introR") %>% | ||
tibble::as_tibble() %>% | ||
dplyr::filter(startsWith(name, "tarea")) | ||
} else if (tipo == "pizarra") { | ||
tutoriales <- learnr::available_tutorials("ixpantia.introR") %>% | ||
tibble::as_tibble() %>% | ||
dplyr::filter(startsWith(name, "pizarra")) | ||
} | ||
return(tutoriales) | ||
} | ||
|
||
#' @title Instalar dependendencias | ||
#' | ||
#' @description Muestra las dependencias del paquete ixpantia.introR que son | ||
#' necesarias para poder practicar con los tutoriales interactivos | ||
#' | ||
#' @details El paquete ixpantia.introR toma en cuenta una cantidad de paquetes | ||
#' que son necesarios para practicar con los tutoriales interactivos. Sino | ||
#' tenemos estos paquetes instalados en nuestro computador, no podremos hacer | ||
#' uso de los tutoriales. Si en algún caso no sabemos cuál paquete nos falta, | ||
#' esta función nos dará la lista de dependencias. | ||
#' | ||
#' @param tipo Es el tipo del tutorial que queremos listar. Puede ser `tarea` o | ||
#' `pizarra` | ||
#' | ||
#' @examples | ||
#'\dontrun{ | ||
#' listar_tutoriales(tipo = "pizarra") | ||
#'} | ||
revisar_dependencias <- function(instalar = FALSE) { | ||
|
||
tutoriales <- learnr::available_tutorials(package = "ixpantia.introR") | ||
lista <- tutoriales$tutorials | ||
return(lista) | ||
if (instalar == TRUE) { | ||
# Si defino paquetes fuera no realiza la instalacion y busca el objeto | ||
install.packages(tutorial_package_dependencies(package = "ixpantia.introR")) | ||
} else { | ||
return(tutorial_package_dependencies(package = "ixpantia.introR")) | ||
} | ||
} | ||
|
||
|
||
|
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.