Hello? I would like to ask a question on R code.
First, here is my raw Excel data, which is a CSV file.
As you can see this photo, zeros in List_code and List_code_2 are written at the very front. However, when I load the CSV file in R studio, zeros disappear. I add a photo on R studio result.
I would like to change numbers like Excel shows. For example, '1475' in List_code and '0' in List_code_2 are needed to convert into '01475' and '00', but '45876' and '10' do not need to change the forms. I tried format() function, but it didn't work. Here is my R codes.
Barcode <- read.csv("Fruit_barcode.csv", header=T)
View(Barcode)
format(Barcode$List_code, format="%Y")
How can I change the code number forms in R data frame? I am looking forward to seeing some answers. Thank you so much.