[R] Excel Data Import using RODBC

2010-02-23 Thread Luis Felipe Parra
Hello I am importing data from Excel to R using RODBC and I am ending up
with the following data frame:

 names(AbioRep)
 [1] Date  US0001W Index US0002W Index US0001M Index
US0002M Index US0003M Index US0004M Index US0005M Index US0006M
Index
[10] US0007M Index US0008M Index US0009M Index US0010M Index
US0011M Index US0012M Index F16   USSA1 Curncy  USSA2
Curncy
[19] USSA3 Curncy

but when I try to call one of its components for example:

 AbioRep$US001 Index
Error: inesperado símbolo en AbioRep$US001 Index

I am getting an error because of the space in the name of the data frame
component. I have tried to replace the space with .  or _ and none have
work. How do I call the components of the data frame which have spaces in
there names? Thank you

Felipe Parra

[[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] Excel Data Import using RODBC

2010-02-23 Thread David Winsemius


On Feb 23, 2010, at 5:17 PM, Luis Felipe Parra wrote:

Hello I am importing data from Excel to R using RODBC and I am  
ending up

with the following data frame:

names(AbioRep)
[1] Date  US0001W Index US0002W Index US0001M Index
US0002M Index US0003M Index US0004M Index US0005M Index  
US0006M

Index
[10] US0007M Index US0008M Index US0009M Index US0010M Index
US0011M Index US0012M Index F16   USSA1 Curncy  USSA2
Curncy
[19] USSA3 Curncy

but when I try to call one of its components for example:

AbioRep$US001 Index
Error: inesperado símbolo en AbioRep$US001 Index


Put quotes around the column names:
 AbioRep$'US001 Index'






I am getting an error because of the space in the name of the data  
frame
component. I have tried to replace the space with .  or _ and none  
have
work. How do I call the components of the data frame which have  
spaces in

there names? Thank you

Felipe Parra

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


__
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] Excel Data Import using RODBC

2010-02-23 Thread Dieter Menne


David Winsemius wrote:
 
 
 Put quotes around the column names:
   AbioRep$'US001 Index'
 
 

Or use AbioRep[,US001 Index]

Dieter

-- 
View this message in context: 
http://n4.nabble.com/Excel-Data-Import-using-RODBC-tp1566728p1567049.html
Sent from the R help mailing list archive at Nabble.com.

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