Una Introducción a la Programación en R
Este curso es una introducción completa al entorno de lenguaje R, que abarca temas fundamentales desde operaciones básicas con vectores numéricos, atributos de objetos, procesamiento de arreglos y matrices, gestión de listas y marcos de datos, hasta modelado estadístico y producción de gráficos de alta calidad. Es especialmente adecuado como texto introductorio para el análisis estadístico y la ciencia de datos.
Descripción del curso
📚 Resumen del contenido
Este curso es una introducción completa al entorno de lenguaje R, cubriendo temas centrales que van desde operaciones básicas con vectores numéricos, atributos de objetos y manejo de arreglos/matrices hasta la gestión de listas y marcos de datos, modelado estadístico y producción de gráficos de alta calidad. Es adecuado como libro de texto introductorio para el análisis estadístico y la ciencia de datos.
Domina lo esencial del lenguaje R y abre la puerta al cálculo estadístico y la visualización de datos.
Autor: Equipo Central de Desarrollo de R
Agradecimientos: Este manual es mantenido por el Equipo Central de Desarrollo de R. La versión en chino agradece la base de la traducción al japonés proporcionada por Shigeru MASE, así como las contribuciones del equipo de traducción al chino liderado por el Dr. ZP Li, el Dr. Rui Li, entre otros.
🎯 Objetivos de aprendizaje
- Iniciar sesiones de R, navegar por el sistema de ayuda y aplicar reglas básicas de sintaxis (sensibilidad al caso, asignaciones y comentarios).
- Distinguir entre y crear vectores lógicos, vectores de caracteres, y manejar valores perdidos (
NAyNaN). - Utilizar cuatro métodos distintos de indexación para seleccionar, excluir o modificar subconjuntos específicos de datos.
- Identificar y modificar los atributos intrínsecos (modo y longitud) de los objetos de R.
- Utilizar las funciones
class()yattr()para gestionar metadatos de objetos y estructuras de datos. - Crear y manipular factores y factores ordenados para representar datos categóricos.
- Definir y construir arreglos y matrices utilizando vectores de dimensiones y la función
array(). - Aplicar técnicas avanzadas de indexación, incluyendo el uso de matrices de índices para extraer o modificar elementos específicos.
- Realizar operaciones de álgebra lineal, incluyendo productos externos, transpuestas generalizadas e inversiones matriciales.
- Construir y modificar listas: crear listas con nombre y sin nombre y combinarlas usando sintaxis específica de R.
Lecciones 共 10 课时 · 预计 30.0h
Lecciones
Lesson
This lesson introduces the R programming environment, focusing on workspace management, the documentation hierarchy, and essential shell commands for project initialization. Students will also learn the fundamentals of R syntax, including the use of the assignment operator, the importance of case sensitivity, and how to utilize built-in examples for troubleshooting.
This lesson explores the fundamental structure of R objects, focusing on atomic vectors as the primary unit of data storage and the importance of homogeneity. Students will learn how to interrogate object properties using diagnostic functions like typeof() and length(), and how to manage data identity through explicit coercion.
This lesson explores the foundations of multi-dimensional data in R, focusing on how arrays are constructed by applying dimension attributes to atomic vectors. Students will learn to perform matrix operations, understand the recycling rule, and utilize k-way arrays to efficiently organize and index large-scale datasets.
This lesson explores advanced data management in R, focusing on the structural differences between homogeneous atomic vectors and heterogeneous lists. Students will learn to organize complex datasets by creating and subsetting lists, manipulating tabular data with data frames, and performing file I/O operations.
This lesson covers the fundamentals of data ingestion and structuring in R, including the use of lists, matrices, and data frames for statistical analysis. It also introduces R’s standardized d-p-q-r prefix system, which provides a unified framework for calculating probability densities, cumulative distributions, quantiles, and random sampling.
This lesson introduces program control in R, focusing on how conditional statements and iterative loops allow scripts to move beyond linear execution to handle dynamic, data-driven logic. Students will learn to implement branching and looping structures to ensure code reliability and achieve predictable outcomes when processing complex datasets.
This lesson explores the transition from manual scripting to automated programming in R by utilizing control flow, vectorized operations, and the apply family of functions. Students will also learn to design custom functions, manage variable scoping, and implement modular code to improve scalability and efficiency.
This lesson explores statistical modeling in R, focusing on the use of data frames, symbolic formula syntax, and polymorphic functions to streamline analysis. Students will learn how to implement linear and non-linear models, perform parameter estimation, and utilize generic extraction tools to evaluate model fit and diagnostics.
This lesson explores the architecture of R graphics, focusing on the Painter’s Model where high-level functions initialize canvases and low-level functions add specific visual layers. Students will learn how to map statistical outputs, such as Hessian matrices from non-linear models, to geometric visualizations while managing R's library environments and plotting paradigms.
This lesson explores the R package ecosystem, distinguishing between the CRAN global repository and local library management while introducing tools for package introspection and environment configuration. Students will also learn about the role of namespaces in ensuring function integrity and how to maintain reproducible, portable code across different system architectures.