R - Split date into dd mm yy

0 votes
How to Split date and convert into separate columns in the dataframe using dplyr pacakge?
Aug 1, 2019 in Data Analytics by misha
1,598 views

1 answer to this question.

0 votes

I use superstore data and show how to extract date parts separately.

> head(superstore$Order.Date,5)
[1] "11-11-2014" "05-02-2014" "17-10-2014" "28-01-2014" "05-11-2014"

> day = strsplit(superstore$Order.Date,split = "-")
> head(day,5)
[[1]]
[1] "11"   "11"   "2014"

[[2]]
[1] "05"   "02"   "2014"

[[3]]
[1] "17"   "10"   "2014"

[[4]]
[1] "28"   "01"   "2014"

[[5]]
[1] "05"   "11"   "2014"
answered Oct 31, 2019 by Cherukuri
• 33,030 points

Related Questions In Data Analytics

0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

answered Mar 26, 2018 in Data Analytics by Bharani
• 4,660 points
813 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,604 views
0 votes
1 answer

How can I import multiple .csv files into R ?

## import_multiple_csv_files_to_R # Purpose: Import multiple csv files ...READ MORE

answered Apr 20, 2018 in Data Analytics by zombie
• 3,790 points
5,983 views
0 votes
1 answer

How to import data from a Json file into R?

Easy and simple: library("rjson") json_file <- "file_name" json_data <- fromJSON(file=json_file)) or ...READ MORE

answered Apr 26, 2018 in Data Analytics by DeepCoder786
• 1,720 points
2,053 views
0 votes
2 answers

How to use group by for multiple columns in dplyr, using string vector input in R?

data = data.frame(   zzz11def = sample(LETTERS[1:3], 100, replace=TRUE),   zbc123qws1 ...READ MORE

answered Aug 6, 2019 in Data Analytics by anonymous
13,638 views
0 votes
1 answer

How to group all columns exculding a single column?

You can either use group_by or group_by_at Using ...READ MORE

answered Apr 12, 2018 in Data Analytics by Sahiti
• 6,370 points
3,173 views
0 votes
1 answer

How to limit output of a dataframe in R?

For randomly sampling a row/cell where a ...READ MORE

answered Apr 18, 2018 in Data Analytics by kappa3010
• 2,090 points
2,865 views
0 votes
1 answer

Using dplyr package to summarise multiple columns - R

'dplyr' package provides 'summarise_all()' function to apply ...READ MORE

answered Jun 6, 2018 in Data Analytics by Bharani
• 4,660 points
1,868 views
0 votes
1 answer
+1 vote
2 answers

Splitting the data into training and testing sets - R

Hi, Try like this. train = sample(x = ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
5,693 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP