I am creating a dataframe using this code:
df <- data.frame(dbGetQuery(con, paste('select * from test')))
Which results in this:
UID BuildingCode AccessTime
1 123456 BUILD-1 2014-06-16 07:00:00
2 364952 BUILD-2 2014-06-15 08:00:00
3 95865 BUILD-1 2014-06-06 09:50:00
I am then trying to remove the row names (1, 2, 3, etc) as suggested here by using this code:
rownames(df) <- NULL
But then when I print out df it still displays the row names. Is there a way to not include the row names when creating the data frame? I found a suggestion about row.name = FALSE but when I tried it I just got errors (I might have placed it in the wrong place).
EDIT: What I want to do is convert the dateframe to a HTML table and I don't want the row name to be present in the table.
row.names = FALSEinwrite.tablerelevant?attributes(df)$row.names <- NULLerases all values form dfdfinto the terminal which then prints out the data frame. I don't havewrite.tablebecause I'm not writing a table (and when I do I'm going to be using xtable).print(df, row.names = F)should do