R retrieve only the value of a variable

r, variables

Solution

See `?unname`, e.g.

unname(x$estimate)

Although all this does is drop the `"names"` attribute. If you have several of these to un-name, it might be easier to bind them all together and then get rid of the row or column names en masse via one of:

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

Or

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

where `obj` is the object containing the data you wish to un-name.

Problem

This may be a super dumb question, that I feel like I should know the answer to. I am using a package called maxstat, when I run a test I get output such as the following: ``` 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 retrieve the value of the estimated cutpoint. So I try: ``` > x$estimate estimated cutpoint 0.6421 ``` How do I just get the value 0.6421 without the attached name "estimated cutpoint"? I want to put this value in a table and when I use cbind or rbind to attach the value(s) the name gets attached as well.

Original source