Create Repetitions of a String in R Programming - strrep() Function Last Updated : 05 Jun, 2020 Comments Improve Suggest changes Like Article Like Report strrep() Function in R Language is used to create specified number of repetitions of a specified string. Syntax: strrep(string, n) Parameter: string: specified string n: number of repetitions Example 1: Python3 1== # R Program to illustrate # the use of strrep function # String to be repeated x <- "Geeks" # Calling strrep() function strrep(x, 5) Output: [1] "GeeksGeeksGeeksGeeksGeeks" Example 2: Python3 1== # R Program to illustrate # the use of strrep function # String to be repeated x <- "Geeks" y <- "4 " # Calling strrep() function strrep(x, 5) strrep(y, 5) strrep(x, 5) Output: [1] "GeeksGeeksGeeksGeeksGeeks" [1] "4 4 4 4 4 " [1] "GeeksGeeksGeeksGeeksGeeks" Comment More infoAdvertise with us Next Article Create Repetitions of a String in R Programming - strrep() Function N nidhi_biet Follow Improve Article Tags : R Language R String-Functions Similar Reads Print a Formatted string in R Programming - sprintf() Function The sprintf() function is used to create formatted strings in R. These formatted strings enable us to insert variables and values into a string while controlling their appearance and formatting. The sprintf() function uses a user-defined format to return a formatted string by inserting the correspon 2 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 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 Extract word from a String at specified position in R Programming - word() Function word() Function in R Language is used to extract words from a string from the position specified as argument. Syntax: word(string, position) Parameter: string: From which word needs to be extracted position: Specified Index value Example 1: Python3 1== # R Program to illustrate # the use of word fun 1 min read Convert String to Integer in R Programming - strtoi() Function strtoi() function in R Language is used to convert the specified string to integers. Syntax: strtoi(x, base=0L) Parameters: x: character vector base: integer between 2 and 36 inclusive, default is 0 Example 1: Python3 # R program to illustrate # strtoi function # Initializing some string vector x 1 min read Getting String Representation of the given Date and Time Object in R Programming - strftime() Function strftime() function in R Language is used to convert the given date and time objects to their string representation. Syntax: strftime(time) Parameters: time: specified time object Example 1:  Python3 # R program to illustrate # strftime function # Specifying a date and time x <- "2020-06-01 16 1 min read Trim a String to a Specified Display Width in R Programming - strtrim() Function strtrim() function in R Language is used to trim a string to a specified display width. Syntax: strtrim(x, width) Parameters: x: character vector width: specified width Example 1: Python3 1== # R program to trim a string # to specified width # Creating a vector x1 <- "GeeksforGeeks" x2 1 min read String Concatenation in R Programming String concatenation is a way of appending two or more strings into a single string whether it is character by character or using some special character end to end. There are many ways to perform string concatenation. Example: Input: str1 = 'Geeks' str2 = 'for' str3 = 'Geeks' Output: 'GeeksforGeeks 3 min read Convert String to Single Quote Text in R Programming - sQuote() Function sQuote() function in R Language is used to convert the given string or character vector into single quote text. Syntax: sQuote(x) Parameters: x: specified string, character vector Example 1: Python3 # R program to illustrate # sQuote function # Initializing a string x <- "GeeksforGeeks" 1 min read Convert a String to an Expression in R Programming - parse() Function parse() function in R Language is used to convert an object of character class to an object of expression class. Syntax: parse(text = character) Parameters: character: Object of character class Example 1: Python3 1== # R program to convert # character to expression # Creating an object of character 1 min read Like