Skip to content

Your feature table has several classes (should be only one)! and Features for dataset No. 1 contains non-integer values! #4

@sophieleech

Description

@sophieleech

Hi,

Perhaps I am missing an obvious solution but I am currently going around in circles between these two errors.

All values in my dataset are integers. And I know this for certain because I used the round() function.

However I was getting this error: Features for dataset No. 1 contains non-integer values!

After digging here I realised this was because of this test typeof(feat.temp) != 'integer'

So I converted using feat.table.integer <- apply(feat.table, 2, function(x) as.integer(as.character(x)))

However this results in

> class(feat.table.integer)
[1] "matrix" "array" 

Which I believe is due to this
So then this error occurs: "Your feature table has several classes (should be only one)!" because of this test length(c.feat) != 1

So to try to get around this I try converting to a data frame using
feat.table.integer <- as.data.frame(feat.table)

But while this fixes the multiple classes error, now

> typeof(feat.table.integer)
[1] "list"

Please help!

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions