R Programming Lab Test for Beginners
The R Programming Lab Test for Beginners is designed to help learners practice essential R coding and data analysis skills. Using RStudio, students can create dataframes, import CSV files, and compute statistical summaries effectively.
Hands-on Practice with Real Data
In this R Programming Lab Test, you will work with a student marks dataset to calculate mean values and analyze subjects. Additionally, tasks such as exporting and importing data will enhance your understanding of R programming fundamentals. Therefore, it’s ideal for beginners exploring data science.
Build Your RStudio Confidence
Moreover, this lab test offers a step-by-step approach to real-world data problems. Practice commands like data.frame(), read.csv(), and aggregate() to boost your coding efficiency. Consequently, learners gain confidence and proficiency in R Programming.
R Programming Lab Test
Use RStudio to perform all tasks. Use the dataframe given below.
Dataset: Student Marks (15 Rows)
| StudentID | Math | Science | English | Social_Science |
|---|---|---|---|---|
| S01 | 85 | 47 | 38 | 65 |
| S02 | 60 | 54 | 52 | 43 |
| S03 | 88 | 87 | 46 | 84 |
| S04 | 47 | 41 | 46 | 57 |
| S05 | 59 | 72 | 38 | 55 |
| S06 | 90 | 81 | 88 | 58 |
| S07 | 73 | 77 | 70 | 30 |
| S08 | 93 | 91 | 55 | 84 |
| S09 | 66 | 57 | 54 | 57 |
| S10 | 93 | 61 | 48 | 41 |
| S11 | 69 | 46 | 80 | 74 |
| S12 | 83 | 56 | 40 | 88 |
| S13 | 79 | 47 | 83 | 40 |
| S14 | 80 | 58 | 81 | 54 |
| S15 | 90 | 44 | 40 | 59 |
Test Questions
- Create this dataframe in RStudio using
data.frame(). - Export the dataframe as a CSV file named student_marks.csv.
- Import this CSV file into RStudio using
read.csv(). - Find the mean of each numerical column separately (Math, Science, English, Social_Science).
- Create a new dataframe named
mean_datacontaining only the means of all subjects. - Using the
aggregate()function, calculate the mean of all subject columns.
CSV to be Saved as: student_marks.csv
StudentID,Math,Science,English,Social_Science S01,85,47,38,65 S02,60,54,52,43 S03,88,87,46,84 S04,47,41,46,57 S05,59,72,38,55 S06,90,81,88,58 S07,73,77,70,30 S08,93,91,55,84 S09,66,57,54,57 S10,93,61,48,41 S11,69,46,80,74 S12,83,56,40,88 S13,79,47,83,40 S14,80,58,81,54 S15,90,44,40,59

