[R] Converting dataframe to matrix

Daniel Lobo d@n|e|obo9976 @end|ng |rom gm@||@com
Thu Jun 26 00:15:50 CEST 2025


Hi,

I have a dataframe for which all columns are numeric but categorical. There
are some missing values as well

Typically, I have CSV file saved in drive, and then read it using read.csv
command

Can I use as.matrix(na.omit(<<my dataframe loaded using read.csv>>)) to
convert such dataframe to matrix?

I there any data loss or change that may occur if I use as.matrix command?

I remember that some experts recommends not to use as.matrix() command to
convert a dataframe to matrix.

Any guidance will be very helpful.

Thanks,

	[[alternative HTML version deleted]]



More information about the R-help mailing list