提取' double'的y值物品。 r
我使用CO2
数据集来举例说明。
co2_dec <- decompose(co2)
co2_trend <- co2_dec$trend
typeof(co2_trend)
我想提取co2_trend
项目的y值。
感谢您的时间。
I use co2
dataset to exemplify.
co2_dec <- decompose(co2)
co2_trend <- co2_dec$trend
typeof(co2_trend)
And I want to extract Y values of co2_trend
item.
Thanks for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以做的是
co2_trend
的as.data.frame
。然后,您在数据框中具有像这样的“ y值”中的值:输出
head(co2_trend,15)
:What you can do is make
as.data.frame
of theco2_trend
. Then you have the values in a dataframe which are your "Y values" like this:Output
head(co2_trend, 15)
:我正在阅读您的帖子中的评论,并且(如果我很好地了解您)您已经拥有了想要的东西。您说您想要CO2_TREND中的所有值,并且可以看到CO2_TREND是双对象。
因此,您可以说(例如)CO2_trend [1:10]并获取实际的十个第一个数字。 则包括一些NA
在您的情况下,如果您不想要co2_trend的桌子式结构,
,您可以使用:这将为您从头到尾提供所有数字:
如果不是您想要的,请让我知道可以帮助您:)
I was reading the comments in your post and (if I understood you well) you already have what you want. You said you want all values from co2_trend and you can see that co2_trend is a double object.
In consequence, you can say (for example) co2_trend[1:10] and get the actual ten first numbers. Which in your case includes some NA's
If you don´t want the table-like structure of co2_trend, you can use:
Which will give you all the numbers from start to end:
Please let me know if this is not what you wanted so I can help you :)
似乎已经回答了,但这是您拥有的另一个选择:
Seems already answered, but this is another option you have: