

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to print the exact values of all elements in a column of an R data frame?
To print the exact values of all elements in a column of an R data frame, we can follow the below stops −
First of all, create a data frame.
Then, use options function and provide the required number of digits for printing.
Example
Create the data frame
Let’s create a data frame as shown below −
x<- sample(c(1.1525412,1.25743874,2.36987321,3.6527142,1.98742315,6.25429836,2.111685723,3.200447169),25,replace=TRUE) df<-data.frame(x) df
Output
On executing, the above script generates the below output(this output will vary on your system due to randomization) −
x 1 6.254298 2 1.152541 3 1.152541 4 1.152541 5 3.652714 6 2.111686 7 1.152541 8 6.254298 9 1.257439 10 2.369873 11 2.111686 12 2.111686 13 1.257439 14 1.152541 15 3.652714 16 2.111686 17 1.152541 18 3.652714 19 2.111686 20 1.152541 21 1.152541 22 1.257439 23 3.652714 24 1.257439 25 3.652714
Print exact values of all elements
Using options function and providing 16 digits for printing as shown below −
x<- sample(c(1.1525412,1.25743874,2.36987321,3.6527142,1.98742315,6.25429836,2.111685723,3.200447169),25,replace=TRUE) df<-data.frame(x) options(digits=16) df
Output
x 1 3.200447169 2 6.254298360 3 2.369873210 4 6.254298360 5 3.200447169 6 3.200447169 7 1.152541200 8 6.254298360 9 2.111685723 10 1.257438740 11 1.987423150 12 1.257438740 13 6.254298360 14 3.200447169 15 3.652714200 16 2.111685723 17 6.254298360 18 1.152541200 19 1.152541200 20 3.200447169 21 3.200447169 22 1.257438740 23 2.111685723 24 2.111685723 25 2.111685723
- Related Questions & Answers
- How to plot all the values of an R data frame?
- How to find the sum of column values of an R data frame?
- How to find the unique values in a column of an R data frame?
- How to find the mean of all values in an R data frame?
- How to find the sum of squared values of an R data frame column?
- How to create a column with the serial number of values in character column of an R data frame?
- How to visualize the normality of a column of an R data frame?
- How to find the percentage of missing values in each column of an R data frame?
- Find the unique pair combinations of an R data frame column values.
- How to count the number of occurrences of all unique values in an R data frame?
- How to extract a single column of an R data frame as a data frame?
- How to replace missing values in a column with corresponding values in other column of an R data frame?
- How to find the number of non-empty values in an R data frame column?
- How to find the sum of non-missing values in an R data frame column?
- How to divide row values of a numerical column based on categorical column values in an R data frame?
Advertisements