Generated by Bing Image Creator: far away landscape, white mountains, green fields, blue sky, photo
In this post, I will do some data analysis for Kaggle's "Gym Memners Exercise Dataset"
It is in Gym Members Exercise Dataset, or
https://www.kaggle.com/datasets/valakhorasani/gym-members-exercise-dataset
I downloaded CVS file.
I got above CSV file. I insert 2nd row for my original variable names.
Now, let's usu R. and RStudio. First, I load "tidyverse" package.
Then, I use read_csv() function to load the CVS file into R.
I use glimpse() function to see gym_raw dataframe.
This dataframe ahs 973 obervations and 15 variables.
Here are explanations for variables.
- age: Age of the gym member.
- gender: Gender of the gym member (Male or Female).
- weight: Member’s weight in kilograms.
- height: Member’s height in meters.
- maxbpm: Maximum heart rate (beats per minute) during workout sessions.
- avgbpm: Average heart rate during workout sessions.
- restbpm: Heart rate at rest before workout.
- hours: Duration of each workout session in hours.
- calories: Total calories burned during each session.
- type: Type of workout performed (e.g., Cardio, Strength, Yoga, HIIT).
- fatpct: Body fat percentage of the member.
- water: Daily water intake during workouts.
- days: Number of workout sessions per week.
- level: Level of experience, from beginner (1) to expert (3).
- bmi: Body Mass Index, calculated from height and weight.
Since gener and type are character string data, I change the both to factor and I also change level to factor because type is bigneer, middle and expert.
Then, let's use summary() function to see dataframe summary.
There is no NAs.
That's it. Thank you!
Next post is
Today's code is below.
# Load tidyvers package
library(tidyverse)
#
# Read the CSV file.
gym_raw <- read_csv("kaggle_gym.csv",
skip = 1)
#
# glimpse()
glimpse(gym_raw)
#
# Change gender, type and level to factor
gym_raw <- gym_raw |>
mutate(gender = as_factor(gender),
type = as_factor(type),
level = as_factor(level))
#
# summary dataframe
summary(gym_raw)