Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to print the structure of an R object to the console

Tags:

r

What is the command for printing the structure of R objects so the object can be re-created by running the printed output?

The output often contains the structure function, and you can copy and paste the output into your code in order to easily create an object for a reproducible example.

I'm breaking my head all morning over this command that I ought to know.

like image 705
Mischa Vreeburg Avatar asked Apr 03 '12 10:04

Mischa Vreeburg


People also ask

How do you find the structure of an object in R?

Display the internal Structure of an Object in R Programming – str() Function. str() function in R Language is used for compactly displaying the internal structure of a R object. It can display even the internal structure of large lists which are nested.

How do I print the console in R?

Most common method to print output in R program, there is a function called print() is used. Also if the program of R is written over the console line by line then the output is printed normally, no need to use any function for print that output. To do this just select the output variable and press run button.

How do I print the value of an object in R?

identity() function in R Language is used to print the value of the object which is passed to it as argument.

What does the STR () function and the summary () function do in R?

Summary: str() - structure of the object and information about the class, length and content of each column. summary() - summary statistics for each column.


1 Answers

The function is dput (or dump).

like image 173
Joshua Ulrich Avatar answered Sep 22 '22 04:09

Joshua Ulrich