A:
I would use format = 1 but have not done a test.
# Update and update...
library(tidyverse)
library(plyr)
# Use data from my question:
dd %
mutate(`_LAST_` = format(Date, "%m-%d-%Y")) %>%
mutate(`_LAST_` = ifelse(Date >= "02/01/2002", 1, "0"))
dd
# Date X1 X2 _LAST_
# 1 2002-01-01 1 21 01
# 2 2002-03-01 2 22 01
# 3 2002-05-01 3 23 01
# 4 2002-06-01 4 24 01
# 5 2002-10-01 5 25 01
# 6 2002-10-01 6 26 01
# 7 2002-20-01 7 27 01
If you want to remove all leading zeros in a dataframe or column:
dd %>%
mutate_each(funs(as.integer(sprintf("%01d",.))))
If you only want leading zeros on every nth row (for example every 4th row or every 5th row):
set.seed(111)
dd %>%
mutate_each(funs(as. 01e38acffe
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey C Geometri Indir 22.pdf
An error occurred: User doesn't have Read access to the kernel. navigate_nextminimize. kaggle kernels output ficthesichoo/new-birey-c-geometri- .
Birey
Related links:
Comments