psych

One of the omegaSem function arguments is an object not found

十年热恋 提交于 2020-01-16 09:09:34
问题 I am reformulating this question because it seems that the information that I provided before is not that clear. I'm new using R so I'm not able yet to identify the most common and simple errors. So I'm following a tutorial to perform a McDonald Omega analysis to estimate reliability on a psychometric test, here is the link just to make you sure about source of the information that I'm using: http://personality-project.org/r/psych/HowTo/omega.pdf To run that analyisis, we work with the "psych

How to save plot generated by pairs.panels from R's psych library in Jupyter

我怕爱的太早我们不能终老 提交于 2020-01-06 19:31:42
问题 I'm using R's psych library and I'm plotting correlation pairs on a Jupyter notebook using its pairs.panels function. I tried using ggplot's ggsave function to save the plot but it wouldn't work. The error says: Error in ggsave(filename = "correlation-pairs.png", : plot should be a ggplot2 plot Is there a way to save the output of pairs.panels ? 来源: https://stackoverflow.com/questions/33819676/how-to-save-plot-generated-by-pairs-panels-from-rs-psych-library-in-jupyter

How to emit YAML in Ruby expanding aliases

ぐ巨炮叔叔 提交于 2019-12-20 02:29:14
问题 I am looking for a way to emit YAML files avoiding the use of aliases (mostly for simplified human readability). I think extending Psych::Visitors::Emitter or Psych::Visitors::Visitor is the way to go, but I cannot actually find where Ruby decides whether to dump an anchor in full, or reference it with an alias. I wouldn't even mind if the anchors were used repeatedly (with their &...... references), I just need to expand aliases to the full structures. I am aware of similar questions being

Ruby - LoadError enc/trans/single_byte

こ雲淡風輕ζ 提交于 2019-12-19 07:09:17
问题 I encountered a weird problem while using ActiveRecord::Store module in my Ruby on Rails app. As I understand, this module use 'serialize' method under the hood so it just serialize your data to yaml format with ruby built-in psych gem. It works OK most of the time, but sometimes I get 500 error with the following message: LoadError (cannot load such file -- enc/trans/single_byte): ~/.rbenv/versions/1.9.3-p286/lib/ruby/1.9.1/psych/visitors/emitter.rb:27:in `write' ~/.rbenv/versions/1.9.3-p286

YAML::load raises undefined class/module error

喜欢而已 提交于 2019-12-19 05:46:31
问题 I’m implementing paper trail like feature in my rails app. In order to do this, I’m serializing object in YAML. I’ve got item_at_version method, which basically does YAML::load(cached_object) – this works pretty well, however, I have no idea why, sometimes it returns undefined class/module _class name_ . It works with models like Event, Conversation, Note, and many more, but without any reason, it seems to throw that error for models like Dataset, Comment, Student (I’ve tried to find any

Installing libyaml for ruby on a mac osX (Lion)

六月ゝ 毕业季﹏ 提交于 2019-12-18 13:34:02
问题 I am getting this error message: "It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby." I have tried entering this command: rvm pkg install libyaml and I am getting this error message: "Fetching yaml-0.1.4.tar.gz to /Users/luke/.rvm/archives Extracting yaml-0.1.4.tar.gz to /Users/luke/.rvm/src Error running 'tar xmzf /Users/luke/.rvm/archives/yaml-0.1.4.tar.gz -C /Users/luke/.rvm/src ', please read

Having trouble installing any ruby 1.9.x (with rbenv) on mac osx due to psych YAML parse errors

*爱你&永不变心* 提交于 2019-12-18 09:24:05
问题 I tried to get rvm uninstalled in order to use rbenv on my Mac. Everything works fine until ruby comes into play.. when using rbenv install 1.9.3-p194 it compiles it correctly, but after that I'd like to install bundler.. this produces the following error computer:~ computer$ gem install bundler /Users/computer/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): mapping values are not allowed in this context at line 1 column 34 (Psych::SyntaxError) from /Users

How to dump strings in YAML using literal scalar style?

丶灬走出姿态 提交于 2019-12-17 20:37:23
问题 I have a big string of formatted data (e.g. JSON) that I want to dump to YAML using Psych in ruby while preserving formatting . Basically, I want for JSON to appear in YAML using literal style: --- json: | { "page": 1, "results": [ "item", "another" ], "total_pages": 0 } However, when I use YAML.dump it doesn't use literal style. I get something like this: --- json: ! "{\n \"page\": 1,\n \"results\": [\n \"item\", \"another\"\n ],\n \"total_pages\": 0\n}\n" How can I tell Psych to dump