Convert a String into Date Format in R Programming - as.Date() Function Last Updated : 30 Jun, 2020 Comments Improve Suggest changes Like Article Like Report as.Date() function in R Language is used to convert a string into date format. Syntax: as.Date(x, format) Parameters: x: string variable format: Format in which string is declared(%m/%d/%y) Example 1: Python3 1== # R program to convert string into date # Creating a string vector dates <- c("27 / 02 / 92") # Conversion into date format result<-as.Date(dates, "% d/% m/% y") # Print result print(result) Output: [1] "1992-02-27" Example 2: Python3 1== # R program to convert string into date # Creating a string vector dates <- c("02 / 27 / 92", "02 / 27 / 92", "01 / 14 / 92", "02 / 28 / 92", "02 / 01 / 92") # Conversion into date format result<-as.Date(dates, "% m/% d/% y") # Print result print(result) Output: [1] "1992-02-27" "1992-02-27" "1992-01-14" "1992-02-28" "1992-02-01" Comment More infoAdvertise with us Next Article Convert a String into Date Format in R Programming - as.Date() Function N nidhi_biet Follow Improve Article Tags : R Language R String-Functions R Date-Function Similar Reads Convert a Vector into Factor in R Programming - as.factor() Function as.factor() function in R Programming Language is used to convert the passed object(usually Vector) into a Factor. Syntax: as.factor(object) Parameters: Object: Vector to be convertedas.factor() Function in R ExampleExample 1: Convert a Factor in RR # Creating a vector x<-c("female", "male", "ma 1 min read Convert an Object to Data Frame in R Programming - as.data.frame() Function as.data.frame() function in R Programming Language is used to convert an object to data frame. These objects can be Vectors, Lists, Matrices, and Factors. Syntax: as.data.frame(object) Parameters: object: Vector, Matrix, factor, or data frameR - as.data.frame() Function ExampleExample 1: Basic exam 2 min read Formatting Numbers and Strings in R Programming - format() Function In R programming, the format() function formats numbers, strings and dates to meet presentation needs. It gives formatting features to modify the display of numeric values, strings and date/time information. This function is applied to regulate the number of decimal places, alignment, scientific not 3 min read Convert an Object to a String in R Programming - toString() Function toString() function in R Language is used to convert an object into a single character string. Syntax: toString(x, width) Parameters: x: Object width: maximum string width Example 1: Python3 1== # R program to convert an object to string # Creating a vector x <- c("Geeks", "for 1 min read Convert String to Double Quote Text in R Programming - dQuote() Function dQuote() function in R Language is used to convert the given string or character vector into double quote text. Syntax: dQuote(x) Parameters: x: specified string, character vector Example 1: Python3 # R program to illustrate # dQuote function # Initializing a string x <- "GeeksforGeeks" 1 min read Convert a Numeric Object to Character in R Programming - as.character() Function as.character() function in R Language is used to convert a numeric object to character object. Syntax: as.character(x) Parameters: x: Numeric Object Example 1: Python3 1== # R program to convert a numeric object # to character object # Calling as.character() function as.character(1) as.character(2 + 1 min read Parsing Date and Time in R Programming - strptime() Function strptime() function in R Language is used to parse the given representation of date and time with the given template. Syntax: strptime(x, format, tz = "")Parameters: x: given representation of date and time y: given template in which parsing is done tz: a character string specifying the time zone t 1 min read Convert a Character Object to Integer in R Programming - as.integer() Function as.integer() function in R Language is used to convert a character object to integer object. Syntax: as.integer(x) Parameters: x: Character Object Example 1: Python3 1== # R program to convert a character object # to an integer object # Calling as.integer() function as.integer("4") as.inte 1 min read Get Date and Time in different Formats in R Programming - date(), Sys.Date(), Sys.time() and Sys.timezone() Function date() function in R Language is used to return the current date and time. Syntax: date() Parameters: Does not accept any parameters Example: Python3 # R program to illustrate # date function # Calling date() function to # return current date and time date() Output: [1] "Thu Jun 11 04:29:39 2020" Sy 1 min read Determine the Month on a Specific Date in R Programming - months() Function months() function in R Language is used to determine the month on a specific date passed to it as argument. Syntax: months(date, abbreviate) Parameters: date: Date to be checked abbreviate: Boolean value to abbreviate month Example 1: Python3 1== # R program to find the month # on a specific date # 1 min read Like