Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer this in R. Below is a description a a data set I am working with,

ID: 3357744 • Letter: P

Question

Please answer this in R. Below is a description a a data set I am working with, and then the question. Thanks

The data set consists of 214 rows of data in which each row corresponds to a glass sample. Each row consists of 10 columns. When viewed as a classification problem, column 10 (Type) specifies the class of each observation/instance. The remaining columns are attributes that might be used to infer column 10.

Question:  Create a vector called “index” with indices for all observations. Since there are 214 rows, your vector “index” should contains the values 1 to 214

Explanation / Answer

In order to create a vector in R use the following command

use the seq function in R

index<- seq(1,nrow(yourdf),by=1)

This shall give a vector of number of rows as index