Hi all,

When running a prediction using RF on another data, I get two columns
returned: row number(?) and predicted class. Is there a way of
appending the unique row value from an ID column in the dataframe to
the predictions instead of the row number? I'm assuming that the
returned results follow the data frame in that the first result
returned equals the first entry in the dataframe.

i.e., instead of a prediction output like this:

1, ants
2, ants
3, bees
4, ants

I'd like the first column to pull IDs from the dataframe associated
with each row (row number in parenthesis for illustration):

(1) 1130, ants
(2) 1130, ants
(3) 2139, bees
(4) 1130, ants

This is likely a simple procedure, but I haven't been able to get
anything to work. Any help would be appreciated!

Cheers,

Dennis

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to