R retrieves only the value of a variable

This can be a very stupid question, and I feel I need to know the answer.

I use a package called maxstat, when I run the test, I get output, for example:

Maximally selected Wilcoxon statistics using none data: x and scores M = 8.3107, p-value = NA sample estimates: estimated cutpoint 0.6421 

I call this output "x" and I only want to get the value of the evaluation point. Therefore, I try:

 > x$estimate estimated cutpoint 0.6421 

How can I get the value 0.6421 without the attached name "estimated point"?

I want to put this value in a table, and when I use cbind or rbind to append the values, the name will also be attached.

+4
source share
1 answer

See ?unname for example

 unname(x$estimate) 

Although all of this, this is a drop in the "names" attribute. If you have several of them for rejecting the name, it may be easier to link them all together, and then get rid of the names of rows or columns in bulk through one of:

 rownames(obj) <- NULL colnames(obj) <- NULL 

or

 dimnames(obj) <- list(NULL, NULL) 

where obj is an object containing the data you want to cancel.

+7
source

Source: https://habr.com/ru/post/1435372/


All Articles