Convert an Expression to a String in R Programming - deparse() Function Last Updated : 24 Jun, 2020 Comments Improve Suggest changes Like Article Like Report deparse() function in R Language is used to convert an object of expression class to an object of character class. Syntax: deparse(expr) Parameters: expr: Object of expression class Example 1: Python3 1== # R program to convert # expression to character # Creating an object of expression class x <- expression(sin(pi / 2)) # Class of object class(x) # Calling deparse() Function x1 <- deparse(x) # Class of parsed object class(x1) Output: [1] "expression" [1] "character" Example 2: Python3 1== # R program to convert # expression to character # Creating an object of expression class x <- expression(2 ^ 3) # Evaluating the value of object eval(x) # Calling deparse() Function x1 <- deparse(x) # Evaluating the value of object eval(x1) Output: [1] 8 [1] "expression(2^3)" Comment More infoAdvertise with us Next Article Convert an Expression to a String in R Programming - deparse() Function N nidhi_biet Follow Improve Article Tags : R Language R String-Functions Similar Reads 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 Create an Expression in R Programming - expression() Function expression() function in R Language is used to create an expression from the values passed as argument. It creates an object of the expression class. Syntax: expression(character) Parameters: character: Expression, like calls, symbols, constants Example 1: Python3 1== # R program to create an expres 1 min read Evaluate an Expression in R Programming - eval() Function eval() function in R Language is used to evaluate an expression passed to it as argument. Syntax: eval(expr) Parameters: expr: expression to be evaluated Example 1: Python3 1== # R program to evaluate an expression # Calling eval() Function eval(sin(pi / 3)) eval(5 + 2) eval(cos(2)) Output: [1] 0.86 1 min read Evaluate and Quote an Expression in R Programming - bquote() Function bquote() function in R Language is used to quote the arguments passed to it, except the values which are wrapped in '.()'. It evaluates the wrapped values and quotes the result. Syntax: bquote(expr) Parameters: expr: language object Example 1: Python3 1== # R program to quote an expression # Assigni 1 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 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 Extracting Substrings from a Character Vector in R Programming - substring() Function substring() function in R Programming Language is used to extract substrings in a character vector. You can easily extract the required substring or character from the given string. Syntax: substring(text, first, last) Parameters:Â text: character vectorfirst: integer, the first element to be replac 1 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 Like