简体   繁体   English

如何读取R中生成的数据框中的指定列?

[英]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.

相关问题 如何将3列数据帧保存到R中的NetCDF文件中? - How can I save a 3 column data frame into a NetCDF file in R? 如何从 R 中的数据框中删除指定行,但根据另一个列变量消除行? - How do I remove specified rows from a data frame in R, but the rows are eliminated according to another column variable? 如何根据R中的预先指定的列对数据框进行分组 - How to group a data frame based on pre-specified column in R 如何找到数据框中完整案例的数量并使用 R 生成仅包含列的指定值的小计的新数据框? - How do I find the number of complete cases in a data frame and produce a new data frame with only subtotals for a specified value of a column using R? 如何从 R 中的reactive() 生成的数据框中调用列? - How to call a column from a data frame generated by reactive() in R shiny? 按指定的列长度将ASCII数据读入R - Read ASCII data into R by specified column lengths 在 R 数据框中,对于给定的行,如何找到 A 列中的值与 B 列中的值的百分比? - In an R data frame, for a given row, how can I find what percentage a value in column A is of a value in column B? 如何在R中使用值列和标签列可视化data.frame? - How can I visualize a data.frame with a values column and a label column in R? 如何在 R 中添加一个列,其值引用不同数据框中的列? - How can I add a column in R whose values reference a column in a different data frame? 如何在 R 的数据框中添加新列并使用现有列? - How can I add a new column and use an existing column in a data frame in R?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM