Create Repetitions of a String in R Programming - strrep() Function Last Updated : 05 Jun, 2020 Summarize Comments Improve Suggest changes Share 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 Like