Re: [R] can't open file

2010-07-08 Thread Sebastian Kruk
 I tried:

 L - readLines(con - file(log2.log, encoding=UCS-2LE)
 z - read.zoo(textConnection(L), index = 1:2,FUN = function(x)
 paste(x[,1], x[,2]))

 Error:
 Error en x[, 1] : número incorreto de dimensiones


Please provide a reproducible example like this:

library(zoo)
L - 4/4/200 10:10:10 3000
5/5/2000 12:12:12 4000
read.zoo(textConnection(L), index = 1:2, FUN = function(x) paste(x[,1], 
x[,2]))

which gives me
 4/4/200 10:10:10 5/5/2000 12:12:12
3000  4000

1st line
#Prueba
Second line
04/04/200 10:10:10 3000 Juan
2nd
05/05/2000 12:12:12 4000 -
...
10th line:
05/04/2010 10:10:10 3000 Juan
...
nth line
01/01/2009 21:10:10 50 Varela
...
last line
11/11/2008 23:20:32 5091 Laura

It's a window's unicode text file.

__
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.


Re: [R] can't open file

2010-07-08 Thread Gabor Grothendieck
On Thu, Jul 8, 2010 at 8:47 AM, Sebastian Kruk residuo.so...@gmail.com wrote:
 I tried:

 L - readLines(con - file(log2.log, encoding=UCS-2LE)
 z - read.zoo(textConnection(L), index = 1:2,FUN = function(x)
 paste(x[,1], x[,2]))

 Error:
 Error en x[, 1] : número incorreto de dimensiones


Please provide a reproducible example like this:

library(zoo)
L - 4/4/200 10:10:10 3000
5/5/2000 12:12:12 4000
read.zoo(textConnection(L), index = 1:2, FUN = function(x) paste(x[,1], 
x[,2]))

which gives me
  4/4/200 10:10:10 5/5/2000 12:12:12
            3000              4000

 1st line
 #Prueba
 Second line
 04/04/200 10:10:10 3000 Juan
 2nd
 05/05/2000 12:12:12 4000 -
 ...
 10th line:
 05/04/2010 10:10:10 3000 Juan
 ...
 nth line
 01/01/2009 21:10:10 50 Varela
 ...
 last line
 11/11/2008 23:20:32 5091 Laura

 It's a window's unicode text file.


We need to be able to reproduce what you have done to offer more than
guesses.  Read the last line at the bottom of every message to r-help.

__
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.


Re: [R] can't open file

2010-07-07 Thread Henrique Dallazuanna
You've tried this?

out - read.zoo(log2.log, encoding=UCS-2LE, FUN = as.chron)

On Wed, Jul 7, 2010 at 10:16 AM, Sebastian Kruk residuo.so...@gmail.comwrote:

 I have a text file log2.log encoded Ansi in Windows.

 When I execute:

 out - read.zoo(readLines(con - file(log2.log,
 encoding=UCS-2LE)),FUN = as.chron)

 have errors:

 Error en file(file, rt) : no se puede abrir la conexión
 Además: Mensajes de aviso perdidos
 1: In file(file, rt) :
  sólo fue usado el primer elemento del argumento 'description'
 2: In file(file, rt) :
  no fue posible abrir el archivo '#Software: Microsoft Internet
 Information Services 5.0': No such file or directory

 Why?

 Thks,

 Sebastián.

 __
 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.




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

[[alternative HTML version deleted]]

__
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.


Re: [R] can't open file

2010-07-07 Thread Gabor Grothendieck
On Wed, Jul 7, 2010 at 9:16 AM, Sebastian Kruk residuo.so...@gmail.com wrote:
 I have a text file log2.log encoded Ansi in Windows.

 When I execute:

 out - read.zoo(readLines(con - file(log2.log,
 encoding=UCS-2LE)),FUN = as.chron)

 have errors:

 Error en file(file, rt) : no se puede abrir la conexión
 Además: Mensajes de aviso perdidos
 1: In file(file, rt) :
  sólo fue usado el primer elemento del argumento 'description'
 2: In file(file, rt) :
  no fue posible abrir el archivo '#Software: Microsoft Internet
 Information Services 5.0': No such file or directory

 Why?


The file argument of read.zoo is a character string giving the *name*
of the file, not the contents of the file as a vector of character
strings.  Alternately it can be a connection (undocumented but works)
or a data.frame so you likely want one of these:

read.zoo(file(log2.log, encoding=UCS-2LE), FUN = as.chron)
read.zoo(log2.log, FUN = as.chron)

See the examples section of ?read.zoo for more examples.

__
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.


Re: [R] can't open file

2010-07-07 Thread Sebastian Kruk
If I edit(out):

structure(logical(0), .Dim = c(707L, 0L), .Dimnames = list(NULL,
NULL), index = structure(1:707, format = m/d/y, origin = structure(c(1,
1, 1970), .Names = c(month, day, year)), class = c(dates,
times)), class = zoo)

I tried:

z - read.zoo(textConnection(L), index = 1:2,FUN = function(x)
paste(x[,1], x[,2]))

I have de following error:

Error en x[, 1] : número incorreto de dimensiones

2010/7/7 Henrique Dallazuanna www...@gmail.com:

 You've tried this?

 out - read.zoo(log2.log, encoding=UCS-2LE, FUN = as.chron)

 On Wed, Jul 7, 2010 at 10:16 AM, Sebastian Kruk residuo.so...@gmail.com
 wrote:

 I have a text file log2.log encoded Ansi in Windows.

 When I execute:

 out - read.zoo(readLines(con - file(log2.log,
 encoding=UCS-2LE)),FUN = as.chron)

 have errors:

 Error en file(file, rt) : no se puede abrir la conexión
 Además: Mensajes de aviso perdidos
 1: In file(file, rt) :
  sólo fue usado el primer elemento del argumento 'description'
 2: In file(file, rt) :
  no fue posible abrir el archivo '#Software: Microsoft Internet
 Information Services 5.0': No such file or directory

 Why?

 Thks,

 Sebastián.

 __
 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.



 --
 Henrique Dallazuanna
 Curitiba-Paraná-Brasil
 25° 25' 40 S 49° 16' 22 O


__
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.


Re: [R] can't open file

2010-07-07 Thread Sebastian Kruk
I tried:

L - readLines(con - file(log2.log, encoding=UCS-2LE)
z - read.zoo(textConnection(L), index = 1:2,FUN = function(x)
paste(x[,1], x[,2]))

Error:
Error en x[, 1] : número incorreto de dimensiones

__
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.


Re: [R] can't open file

2010-07-07 Thread Gabor Grothendieck
On Wed, Jul 7, 2010 at 9:43 AM, Sebastian Kruk residuo.so...@gmail.com wrote:
 I tried:

 L - readLines(con - file(log2.log, encoding=UCS-2LE)
 z - read.zoo(textConnection(L), index = 1:2,FUN = function(x)
 paste(x[,1], x[,2]))

 Error:
 Error en x[, 1] : número incorreto de dimensiones


Please provide a reproducible example like this:

library(zoo)
L - 4/4/200 10:10:10 3000
5/5/2000 12:12:12 4000
read.zoo(textConnection(L), index = 1:2, FUN = function(x) paste(x[,1], x[,2]))

which gives me
 4/4/200 10:10:10 5/5/2000 12:12:12
 3000  4000

__
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.


Re: [R] can't open file

2010-07-07 Thread Duncan Murdoch

On 07/07/2010 9:16 AM, Sebastian Kruk wrote:

I have a text file log2.log encoded Ansi in Windows.
  


What Windows calls Ansi is called latin1 in R.  You said the 
encoding was UCS-2LE, which Windows calls Unicode.  Part of your 
problem might be this mismatched encoding.  Have you tried using 
encoding=latin1 when you read the file?


Duncan Murdoch

When I execute:

out - read.zoo(readLines(con - file(log2.log,
encoding=UCS-2LE)),FUN = as.chron)

have errors:

Error en file(file, rt) : no se puede abrir la conexión
Además: Mensajes de aviso perdidos
1: In file(file, rt) :
  sólo fue usado el primer elemento del argumento 'description'
2: In file(file, rt) :
  no fue posible abrir el archivo '#Software: Microsoft Internet
Information Services 5.0': No such file or directory

Why?

Thks,

Sebastián.

__
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.



__
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.


Re: [R] can't open file

2010-07-07 Thread Sebastian Kruk
In both cases I obtain:

01/02/70
01/03/70
01/04/70
01/05/70
01/06/70
01/07/70
01/08/70
01/09/70
01/10/70
01/11/70
01/12/70
01/13/70
01/14/70
01/15/70
01/16/70
01/17/70
01/18/70
01/19/70
01/20/70
01/21/70
01/22/70
01/23/70
01/24/70
01/25/70
01/26/70
01/27/70
01/28/70
01/29/70
01/30/70
01/31/70
02/01/70
02/02/70
02/03/70
02/04/70
02/05/70
02/06/70
02/07/70
02/08/70
02/09/70
02/10/70
02/11/70
02/12/70
02/13/70
02/14/70
02/15/70
02/16/70
02/17/70
02/18/70
02/19/70
02/20/70
02/21/70
02/22/70
02/23/70
02/24/70
02/25/70
02/26/70
02/27/70
02/28/70
03/01/70
03/02/70
03/03/70
03/04/70
03/05/70
03/06/70
03/07/70
03/08/70
03/09/70
03/10/70
03/11/70
03/12/70
03/13/70
03/14/70
03/15/70
03/16/70
03/17/70
03/18/70
03/19/70
03/20/70
03/21/70
03/22/70
03/23/70
03/24/70
03/25/70
03/26/70
03/27/70
03/28/70
03/29/70
03/30/70
03/31/70
04/01/70
04/02/70
04/03/70
04/04/70
04/05/70
04/06/70
04/07/70
04/08/70
04/09/70
04/10/70
04/11/70
04/12/70
04/13/70
04/14/70
04/15/70
04/16/70
04/17/70
04/18/70
04/19/70
04/20/70
04/21/70
04/22/70
04/23/70
04/24/70
04/25/70
04/26/70
04/27/70
04/28/70
04/29/70
04/30/70
05/01/70
05/02/70
05/03/70
05/04/70
05/05/70
05/06/70
05/07/70
05/08/70
05/09/70
05/10/70
05/11/70
05/12/70
05/13/70
05/14/70
05/15/70
05/16/70
05/17/70
05/18/70
05/19/70
05/20/70
05/21/70
05/22/70
05/23/70
05/24/70
05/25/70
05/26/70
05/27/70
05/28/70
05/29/70
05/30/70
05/31/70
06/01/70
06/02/70
06/03/70
06/04/70
06/05/70
06/06/70
06/07/70
06/08/70


2010/7/7 Gabor Grothendieck ggrothendi...@gmail.com:
 On Wed, Jul 7, 2010 at 9:16 AM, Sebastian Kruk residuo.so...@gmail.com 
 wrote:
 I have a text file log2.log encoded Ansi in Windows.

 When I execute:

 out - read.zoo(readLines(con - file(log2.log,
 encoding=UCS-2LE)),FUN = as.chron)

 have errors:

 Error en file(file, rt) : no se puede abrir la conexión
 Además: Mensajes de aviso perdidos
 1: In file(file, rt) :
  sólo fue usado el primer elemento del argumento 'description'
 2: In file(file, rt) :
  no fue posible abrir el archivo '#Software: Microsoft Internet
 Information Services 5.0': No such file or directory

 Why?


 The file argument of read.zoo is a character string giving the *name*
 of the file, not the contents of the file as a vector of character
 strings.  Alternately it can be a connection (undocumented but works)
 or a data.frame so you likely want one of these:

 read.zoo(file(log2.log, encoding=UCS-2LE), FUN = as.chron)
 read.zoo(log2.log, FUN = as.chron)

 See the examples section of ?read.zoo for more examples.


__
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.