ComenzarEmpieza gratis

Working with Environments (2)

Most types of R variable use "copy by value", meaning that when you take a copy of them, the new variable has its own copy of the values. In this case, changing one variable does not affect the other.

Environments use a different system, known as "copy by reference", so that all copies are identical; changing one copy changes all the copies.

Useful biology fact: RNA bases are slightly different to DNA bases. They are A, C, G, and U.

Este ejercicio forma parte del curso

Object-Oriented Programming with S3 and R6 in R

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Assign lst
lst <- list(
  perfect = c(6, 28, 496),
  bases = c("A", "C", "G", "T")
)

# Copy lst
lst2 <- ___
  
# Change lst's bases element
___
  
# Test lst and lst2 identical
___ 
Editar y ejecutar código