#CONTROL DE VERSIONES UTILIZANDO PROYECTOS Y RENV EN RSTUDIO #Proyecto para RSTUDIO con un ejemplo de control de versiones para estudiar. #Durante las clases del profesor xavier de Pedro se utilizó #Los "proyectos" los gestiona el paquete "renv" de R. El archivo clave de todo esto es el archivo "renv.lock" que se genera en la carpeta del proyecto, en el primer nivel del proyecto, una vez que se ha inicializado el proyecto con renv. #Los apuntes de sus sesiones online pueden encontrarse en: https://seeds4c.org/ds24 #SEGUIR LAS INDICACIONES DE TRAZABILIDAD INDICADAS EN #USE RENV https://rviews.rstudio.com/2018/01/18/package-management-for-reproducible-r-code/ #SEE MORE IN #https://rstudio.github.io/renv/reference/init.html #Use renv in a project #Source: R/init.R #Call renv::init() to start using renv in the current project. This will: # Set up project infrastructure (as described in scaffold()) including the project library and the .Rprofile that ensures renv will be used in all future sessions, #Discover the packages that are currently being used in your project (via dependencies()), and install them into the project library (as described in hydrate()), #Create a lockfile that records the state of the project library so it can be restored by others (as described in snapshot()), #Restart R (if running inside RStudio). #If you call renv::init() with a project that is already using renv, it will attempt to do the right thing: it will restore the project library if it's missing, or otherwise ask you what to do. #CREATE NEW PROJECT WITH OPTION RENV #EXAMPLES library(boot) #SEE YOUR VERSION # confidence intervals for the city data ratio <- function(d, w) sum(d$x * w)/sum(d$u * w) city.boot <- boot(city, ratio, R = 999, stype = "w", sim = "ordinary") boot.ci(city.boot, conf = c(0.90, 0.95), type = c("norm", "basic", "perc", "bca")) #ANALISIS DE LAS DEPENDENCIAS Y VERSIONES sessionInfo()