100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

Data_Mining_&_Statistical_Modeling_Week1_Introduction_to_R

Puntuación
-
Vendido
-
Páginas
10
Grado
A+
Subido en
05-06-2025
Escrito en
2024/2025

Replicate the textbook's code shown in Chapter 2 (2.3 Lab: Introduction to R). 2.3 Lab: Introduction to R In this lab, we will introduce some simple R commands to understand how R works. 2.3.1 Basic Commands 2.3.2 Graphics 2.3.3 Indexing Data 2.3.4 Loading Data

Mostrar más Leer menos
Institución
Data Mining & Statistical Modeling
Grado
Data Mining & Statistical Modeling









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Libro relacionado

Escuela, estudio y materia

Institución
Data Mining & Statistical Modeling
Grado
Data Mining & Statistical Modeling

Información del documento

Subido en
5 de junio de 2025
Número de páginas
10
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

Intro_to_R
John Doe

2025-06-05

2.3 Lab: Introduction to R


In this lab, we will introduce some simple R commands to understand
how R works.
2.3.1 Basic Commands
# Creating a numeric vector with 4 elements
x <- c(1, 3, 2, 5)

# Printing the vector x
x

## [1] 1 3 2 5

# Updating x with a new set of values
x = c(1, 6, 2)

# Printing the updated x
x

## [1] 1 6 2

# Creating another numeric vector with 3 elements
y= c(1, 4, 3)


# Checking the number of elements in x
length(x)

## [1] 3

# Trying to find the length of y (this will give an error because y
doesn't exist yet)
length(y)

## [1] 3

# Adding x and y (will also give an error unless y is defined)
x + y

## [1] 2 10 5

, # Listing all current objects in the environment
ls()

## [1] "x" "y"

# Removing objects x and y from the environment
rm(x, y)

# Checking again to confirm they are removed
ls()

## character(0)

# Removing everything from the environment
rm(list = ls())

# Asking for help on the matrix function
?matrix

## starting httpd help server ... done

# Creating a 2x2 matrix using named arguments
x <- matrix(data = c(1, 2, 3, 4), nrow = 2, ncol = 2)
x

## [,1] [,2]
## [1,] 1 3
## [2,] 2 4

# Creating a matrix without naming the arguments (just positional)
x <- matrix(c(1, 2, 3, 4), 2, 2)

# Creating a matrix where values are filled by row instead of column
matrix(c(1, 2, 3, 4), 2, 2, byrow = TRUE)

## [,1] [,2]
## [1,] 1 2
## [2,] 3 4

# Taking square root of each element in x
sqrt(x)

## [,1] [,2]
## [1,] 1.000000 1.732051
## [2,] 1.414214 2.000000

# Squaring each element in x
x^2

## [,1] [,2]
## [1,] 1 9
## [2,] 4 16
$10.48
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
datascience24 Self
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
84
Miembro desde
3 año
Número de seguidores
16
Documentos
159
Última venta
1 mes hace

Please message me using Send Message option for new assignment requests.

4.5

12 reseñas

5
10
4
0
3
1
2
0
1
1

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes