Hi @Saurish_Seksaria remeber put a reproducible example of your data. If I understand well you need something like that:
install.packages('dplyr')
library(dplyr)
data1 <- data.frame(
Temperature = as.character(c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130)),
Pressure = c(25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 25.5, 26, 27),
Concentration = c(0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.5, 0.7, 0.8, 0.9)
)
# For put all column like numeric type
data1 <- data1 %>%
mutate(across(everything(), as.numeric))
str(data1)
# data.frame': 14 obs. of 3 variables:
# $ Temperature : num "0" "10" "20" "30" ...
# $ Pressure : num 25 25 25 25 25 25 25 25 25 25 ...
# $ Concentration: num 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.
------------
# For select some columns and put like numeric type
data2 <- data.frame(
Temperature = as.character(c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130)),
Pressure = c(25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 25.5, 26, 27),
Concentration = c(0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.5, 0.7, 0.8, 0.9)
)
data2 <- data2 %>%
mutate(across(c(Concentration, Pressure), as.numeric))
str(data2)
# data.frame': 14 obs. of 3 variables:
# $ Temperature : chr "0" "10" "20" "30" ...
# $ Pressure : num 25 25 25 25 25 25 25 25 25 25 ...
# $ Concentration: num 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1