Hi,
You may try:
op <- options(digits=12)
r1 <- 4; c1 <- 4
 A <- matrix(scan("file1.txt",n=r1*c1),r1,c1,byrow=TRUE)

options(op) #reset

A.K.





Dear all, 
I’m using 'scan' function to import data into a matrix from a .txt 
file. The data are numbers with 12 significant digits (e.g. 
471773.309872).   
When I give the command: 

A <- matrix(scan(file_name, n=r*c), r, c, byrow=TRUE) 

numbers are stored in the matrix with only 7 significant digits 
(e.g. 471773.3). How can I increase the number of significant digits? 

Thank you for your reply. 
Eleonora

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to