I have a dataframe of which the columns contain a variable amount of numbers and a variable amount of NA's. The dataframe looks like this:
V1 V2 V3 V4 V5 V6
1 0 11 4 0 0 10
2 0 17 3 0 2 2
3 NA 0 4 0 1 9
4 NA 12 NA 1 1 0
<snip>
743 NA NA NA NA 8 NA
744 NA NA NA NA 0 NA
I want to make a boxplot out of this, but when I do
boxplot(dataframe)
I get the error
adding class "factor" to an invalid object
When I do
lapply(dataframe,class)
I get the folowing output:
$V1
[1] "factor"
$V2
[1] "factor"
<snip>
$V6
[1] "factor"
So how can I change my dataframe so that the columns are seen as numeric?