Skip to content
Prev 295435 / 398506 Next

write.xls

You need to read the documentation for read.xlsx and data.frame.

In it you would discover what you have done wrong:

1. rowIndex must be an array listing the columns you wish to read not a
character value
2. colIndex must be an array listing the rows you wish to read
[Deleting these arguments will read all rows/columns which is probably what
you want]
3. colClasses="character" are you trying to read these numbers as
characters? Fortunately read.xlsx is ignoring your request since the correct
value would be "char". Just delete this argument as well.
4. row.names gets passed to data.frame. It is looking for a number or
character string indicating which column to use as rownumbers. Since you put
TRUE, that gets converted to 1 and your first variable becomes the rowname.
Certainly this is not what you want. Delete this argument as well.

I think you will find this accomplishes what you want

read<-read.xlsx("D:\\FYP\\image\\Cropped
Images\\user227\\user227forger.xlsx", 
sheetName="Sheet1")

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352