R Language: R is a programming language and environment primarily used for statistical computing and graphics. It's popular among statisticians and data miners for data analysis and visualization.
Data Set: In R, a data set is a collection of data organized in a structured format, usually in the form of a table where rows represent individual observations or samples, and columns represent variables or attributes of those observations.
Example: Let's create a simple data set in R. Suppose we want to create a data set of students' exam scores in three subjects: Math, Science, and English.
Example
# Create a data frame (a type of data structure in R) for students' exam scores
student_scores <- data.frame(
Student_ID = c(1, 2, 3, 4, 5), # Student ID numbers
Math = c(85, 72, 90, 78, 88), # Math scores
Science = c(80, 75, 85, 79, 82), # Science scores
English = c(75, 68, 80, 72, 78) # English scores
)
# Print the data set
print(student_scores)
In this example:
Student_ID
is a column containing unique identifiers for each student.Math
, Science
, and English
are columns containing the exam scores of students in each respective subject.The data.frame()
function is used to create a data frame in R. We provide the column names and their corresponding values within the function.
After running this code, you'll see a table printed to the console showing the student IDs along with their scores in Math, Science, and English. This table represents our data set in R.