[英]How can I read the specified column in the generated data frame in R?
Here is my code: 这是我的代码:
x<-c(1300,541,441,35,278,167,276,159,126,60.8,160,5000,718,9740,135,3480,264.6,379,170,251.3,155.84,187.01,850)
y<-log10(x)
# load fitdistrplus package for using fitdist function
library(fitdistrplus)
# fit logistic distribution using MLE method
x.logis <- fitdist(y, "logis", method="mle")
b1 <- bootdist(x.logis, bootmethod="param", niter=20)
b1# Here are 20 b1.
How can i read the parameter values (location) in b1 ? 如何读取b1中的参数值(位置)? Thank you very much ! 非常感谢你 !
Use the str function to inspect the structure of the data. 使用str函数检查数据的结构。 In fact, b1 is a list , and the first object of this list contain a regular data frame. 实际上, b1是一个列表 ,此列表的第一个对象包含常规数据帧。
# extract the data frame for the first object of the list
data <- b1$estim
data$location
data$scale
# Also you can use the double bracket operator
b1[[1]][, "location"]
In the last part of the code you can notice that the double square brackets are used for subset the object of the list, and the normal square brackets are for subset the elements of the object. 在代码的最后部分,您会注意到,双方括号用于子集列表对象,而普通方括号用于子集对象元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.