Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid specification in write.table()

Tags:

r

write.table

I am encountering suddenly this odd error, which I have never come across before in write.table() command:

write.table(items,file="E:/CFA/items.dat",sep="\t",row.names=F,col.names=F) 
Error in write.table(items, file = "E:/CFA/items.dat",  : 
  invalid 'row.names' specification 

When taking away the row.names argument, there is still the same error with col.names one. The data is a data frame which I have already worked with several times with no difficulties to create a .dat file. I am just puzzled.

Does anybody have a clue why it's happening now?

Thanks beforehand

like image 524
Gina Zetkin Avatar asked Sep 11 '26 21:09

Gina Zetkin


2 Answers

Is it possible you have reassigned the F variable somewhere? Try doing it using FALSE instead of F.

write.table(items,file="E:/CFA/items.dat",sep="\t",row.names=FALSE,col.names=FALSE)

like image 105
Pinemangoes Avatar answered Sep 14 '26 10:09

Pinemangoes


Try write.table(items,file="E://CFA//items.dat",sep="\t",row.names=F,col.names=F)

or rm(F,T) and then your command.

like image 41
Trolli Avatar answered Sep 14 '26 11:09

Trolli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!