Skip to content

NA in last row while reading xlsx file

3 messages · ashz, Jean V Adams, David Winsemius

#
Hi,

I am using this script to read a xlsx file to a data frame:
library(xlsx) 
File <- file.path("d:", "car ", "car95-99.xlsx")
B_car <- read.xlsx(File, "raw_data")
Car2x <- data.frame(month = B_car$Date,Ch = B_car$Ch.des,
lat=B_car$Latitude)

The last row in the data.frame is always NA, how can I remove it?

Thx.
    

--
View this message in context: http://r.789695.n4.nabble.com/NA-in-last-row-while-reading-xlsx-file-tp3762119p3762119.html
Sent from the R help mailing list archive at Nabble.com.
#
On Aug 23, 2011, at 8:21 AM, Jean V Adams wrote:

            
OR:  Assuming you want to remove the entire row :

Car_C <- Car_B[-nrow(Car_B), ]