you can also try:
temp[] <- lapply(temp, as.numeric)
On Fri, May 3, 2013 at 11:54 AM, David Winsemius wrote:
>
> On May 2, 2013, at 11:00 PM, jpm miao wrote:
>
> > Hi Anthony,
> >
> > Thank you very much. It works very well. However, after this line
> >
> >> temp <- sapply( temp , as.numeric
On May 2, 2013, at 11:00 PM, jpm miao wrote:
> Hi Anthony,
>
> Thank you very much. It works very well. However, after this line
>
>> temp <- sapply( temp , as.numeric )
>
> the data becomes a series of numbers instead of a matrix. Is there any
> way to keep it a matrix?
Perhaps (assuming
sorry, i had assumed readWorksheetFromFile would give you back a data
frame. all of the operations i recommended work on data.frame objects
at different points in the code, check if it's a data.frame or a matrix..
class( temp )
..you can check its current class at any point.
and if it's a mat
Hi Anthony,
Thank you very much. It works very well. However, after this line
> temp <- sapply( temp , as.numeric )
the data becomes a series of numbers instead of a matrix. Is there any
way to keep it a matrix?
Thanks,
Miao
> temp<-readWorksheetFromFile("130502temp.xlsx", sheet=1
try adding colTypes = 'numeric' to your readWorkSheetFromFile() call
if that doesn't work, try a few other steps
# view what data types your file is being read in as
sapply( temp , class )
# convert all fields to character if they're factor variables.. but i don't
think you need this, readWo
5 matches
Mail list logo