Thank you Ray and Jim.
It works with file.choose().
I post following the output.
Antonio Carazo
Regional Sales Manager FOSS IBERIA.
Ph. D. student in Social Sciences.
list.files()
[1] DATOS1.txt open.exe R.dll
R.exe Rblas.dll Rcmd.exe
[7] RCommander.R RCommander.txt RCommanderMarkdown.Rmd
Rgraphapp.dll Rgui.exe Riconv.dll
[13] Rlapack.dllRscript.exeRSetReg.exe
Rterm.exe Rzlib.dll
DATOS1-matrix(scan(E:/R 3.0.2/R-3.0.2/bin/x64/DATOS1.txt)
+ DATOS1
Error: inesperado símbolo in:
DATOS1-matrix(scan(E:/R 3.0.2/R-3.0.2/bin/x64/DATOS1.txt)
DATOS1
DATOS1()
Error: no se pudo encontrar la función DATOS1
X
[1] 1
DATOS1.txt
Error: objeto 'DATOS1.txt' no encontrado
DATOS1 - matrix(scan(file.choose()), ncol = 8)
Read 112 items
DATOS1
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 320 21 65 207 21 65
[2,] 17 66 14 1267 73 12 125
[3,] 67 22 12 37 63 20 23 31
[4,] 112 25 66 14 109 35 71 16
[5,] 28 66 21 25 20 67 290
[6,] 10 1220 68 10 125 12 72
[7,] 17 23 67 21 34 23 65 22
[8,] 71 12 1258 69 12 1157
[9,] 32 25 20 64 22 50 33 62
[10,]9 68 15 1236 72 13 113
[11,] 64 182 24 62 230 23
[12,] 142 25 67 12 123 25 69 14
[13,] 32 60 410 27 69 31 25
[14,] 14 1017 71 12 1670 78
-Original Message-
From: Ray Brownrigg [mailto:ray.brownr...@ecs.vuw.ac.nz]
Sent: lunes, 26 de mayo de 2014 07:16
To: Antonio Carazo; r-help@R-project.org
Subject: Re: [R] Unable to load a file: no such file or directory
On 26/05/14 10:25, Antonio Carazo wrote:
Hi,
I have the file DATOS1 in the directory E:/R 3.0.2/R-3.0.2/bin/x64.
If I try to load it, R returns me this error:
getwd()
[1] E:/R 3.0.2/R-3.0.2/bin/x64
DATOS1-matrix(scan(E:/R 3.0.2/R-3.0.2/bin/x64/DATOS1),ncol=8)
Error en file(file, r) : no se puede abrir la conexión
Además: Mensajes de aviso perdidos
In file(file, r) :
no fue posible abrir el archivo 'E:/R 3.0.2/R-3.0.2/bin/x64/DATOS1':
No such file or directory
The file DATOS1 is a Text Document with this composition:
32 17 67 112 28 10 17 71
329 64 142 32 140 66
22 25 66 122 23 12 25 68
18 25 60 101 21 14 12 66
210 67 125 20 152 67
417 65 126 37 14 25 68
218 64 123 24 120 71
207 63 109 20 10 34 69
226 62 123 27 127 73
20 35 67 125 23 12 50 72
23 25 69 167 21 12 23 71
29 12 65 115 33 130 69
310 65 125 31 160 72
227 62 113 23 14 25 78
If it's a text document created with a Windows application, then it is very
likely that the file name is really DATOS1.txt. Another useful thing to do in
Windows is to use file.choose() whenever you want to open a file:
DATOS1 - matrix(scan(file.choose()), ncol = 8)
The unit E: is an external hard disk.
It seems like the path were wrong.
I´ve read the FAQ´s, the Windows FAQ´s, the R document about scan() function
and the related sections of An Introduction to R and the Import/Export
manual, but I can´t find any answer of this error.
Can anybody help me, please?
Thank you
Hope this helps,
Ray Brownrigg
__
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.