Psych is a YAML parser and emitter. Psych leverageslibyaml for its YAML parsing and emittingcapabilities. In addition to wrapping libyaml, Psych also knows how toserialize and de-serialize most Ruby objects to and from the YAML format.
# Safely load YAML in to a Ruby object
Psych.safe_load('--- foo') # => 'foo'
# Emit YAML from a Ruby object
Psych.dump("foo") # => "--- foo\n...\n"
Psych has been included with MRI since 1.9.2, and is the default YAML parserin 1.9.3.
If you want a newer gem release of Psych, you can use rubygems:
gem install psych
In order to use the gem release in your app, and not the stdlib version,you'll need the following:
gem 'psych'
require 'psych'
Or if you use Bundler add this to your Gemfile
:
gem 'psych'
JRuby ships with a pure Java implementation of Psych.
If you're on Rubinius, Psych is available in 1.9 mode, please refer to theLanguage Modes section of the RubiniusREADME for more information onbuilding and 1.9 mode.
Copyright 2009 Aaron Patterson, et al.
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the 'Software'), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
R语言使用psych包的describe函数对dataframe数据中的多个数据列进行描述性统计分析(样本量、均值、标准差、中位数、截尾均值、绝对中位差、最小值、最大值、全距、偏度、峰度和均值的标准误等) 目录
R语言使用psych包的fa函数对指定数据集进行因子分析(输入数据为相关性矩阵)、使用rotate参数指定进行正交旋转、斜交旋转提取因子、比较正交旋转和斜交旋转之间的差异、因子结
R语言使用psych包的cor.test函数检验dataframe中多个数值数据列之间的相关性系数是否具有统计显著性、对相关性系数进行显著性检验 目录 R语言使用psych包的cor.test函数检验dataframe中多个数值数据列之间的相关性系数是否具有统计显著性、对相关性系数进行显著性检验
R语言使用psych包进行探索性因子分析EFA、使用cov2cor函数将原始数据的协方差矩阵将其转换为相关性矩阵( covariance matrix transform into correlation matrix、Exploratory factor analysis) 目录
R语言使用psych包的cor.test函数检验dataframe中多个数值数据列之间的相关性系数是否具有统计显著性、对相关性系数进行显著性检验、使用print函数和short参数输出系数的置信区间 目录 R语言使用psych包的cor.test函数检验dataframe中多个数值数据列之间的相关性系数是否具有统计显著性、对
R语言使用psych包的corr.test函数计算所有变量组合对的相关性并给出所有相关性的显著性(Correlation matrix and tests of significance via corr.test()) 目录
R语言偏相关或者部分相关性系数计算实战:使用psych包计算(Partial Correlation)偏相关或者部分相关性系数并用建设检验检验相关性的显著性 目录
R语言使用psych包的fa函数对指定数据集进行因子分析(输入数据为相关性矩阵)、使用rotate参数指定进行斜交旋转提取因子、使用factor.plot函数可视化斜交旋转因子分析、并解读可视化图形 目录
R语言偏相关或者部分相关性系数计算实战:使用psych包计算(Partial Correlation)偏相关系数、拟合回归模型使用两个回归模型的残差计算偏相关性系数 目录
R语言使用psych包的fa函数对指定数据集进行因子分析(输入数据为相关性矩阵)、使用nfactors参数指定抽取的因子的个数、fa函数因子分析结果解读(Extracting common factors) 目录