简体   繁体   中英

mdrr dataset in caret package

The mdrr dataset in caret package is a set of two objects; data.frame ( mdrrDescr ), and an ordinary factor ( mdrrClass ). when I try to run View() command for mdrrClass it shows a factor with zero entries. why is it like this? also how to create a factor like that ? I think it'll be better to understand the question if you just run these commands.

data(mdrr)
class(mdrrClass)
View(mdrrClass)

it says:

"Showing 1 to 0 of 528 entries"

on the source pane.

I think it depends on which version from Rstudio you have. In my case View(mdrrClass) shows me the structure of mdrrClass in the view pane as if you ran dput(mddrClass) .

You can replicate it with a simple example:

set.seed(1234)
ex <- as.factor(sample(1:2, 10, replace = T))
View(ex)

This shows me the dput structure and the values in the view pane.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM