空飛ぶチンアナゴの統計解析日記

統計解析を嗜むチンアナゴのメモ帳です

RStudioバグっていませんか?


久しぶりにRStudioを更新したらなんか警告が出ました。

RStudio cannot write to required folders

RStudio requires write access to the following folders, but writing to them failed:

/Users/(ワシのユーザー名)/.config/rstudio
(EACCES: permission denied, mkdir '/Users/(ワシのユーザー名)/.config/rstudio')

RStudio may fail to start or may not work correctly until this is resolved. Please check that these folders have the expected ownership and permissions.

今まで見たことのない事例だったのですが、調べたら一応解決はできました。

解決方法

1 ターミナルで状況を確認する

ls -ld ~/.config
ls -la ~/.config

とりあえずターミナルで上記のコマンドを叩いて状況を確認します。
おそらく所有者が root になっています。

2. 所有者を自分に戻す

sudo chown -R $(whoami) ~/.config

引き続きターミナルで上記のコマンドを叩きます。
パスワードを求められるので、Macのパスワードを入れます。

3. RStudioを再起動する

これで問題なく起動します。

うまくいかない場合

1. もし ~/.config 自体が存在しない場合

mkdir -p ~/.config

で.configフォルダーを作ってください。

JuliaAcademyなくなったんですね

今更ながらJuliaAcademyが閉鎖されたことを知る

Thank you so much for being a part of JuliaAcademy! I hope you've enjoyed the courses here and have found them helpful in your work with Julia. We at JuliaHub have been proud to sponsor JuliaAcademy from its inception in 2019 up through today. The courses themselves, as I'm sure you've found, have grown old and haven't seen much love lately. We'll be archiving these courses onto the community YouTube channel, where a number were already posted alongside many newer materials. You can find them at https://www.youtube.com/@TheJuliaLanguage/courses.

At JuliaHub, we're continuing to drive the language, scientific machine learning, and modeling and simulation forward. You can find many more details about what we're doing at https://juliahub.com, from the cloud-native platform for Julia to our AI-native simulation and modeling tool, Dyad. Stay atop our latest news and events by signing up for our company newsletter at https://juliahub.com/company/contact-us.

Thanks so much for being a part of the Julia community, and I hope to continue to see you around!

  • Matt Bauman, JuliaHub Inc.

今までのJuliaAcademyはYoutubeで観れるし、今度からはjuliahubを使ってねと言うことなのでしょうか?

juliahub.com

Code in Place 2026

https://codeinplace.stanford.edu
今年もCode in Placeがやってきた!
ということで来週の月曜日からスタートみたいです。
まだギリギリ参加は間に合いそうなので、英語に自信のある方はぜひトライしてみてください。

EndNote X9はTahoe非対応です

【EndNote】macOS Tahoe 26 と EndNote の互換性について(11/19更新)

2025年9月、Apple 社から macOS Tahoe 26 がリリースされました。
各バージョンとの互換性については下記の通りです。

【EndNote 2025、21】
EndNote の開発元のクラリベイト社で動作検証を行った結果、macOS Tahoe 26 との互換性が確認できました。
EndNote 2025、21 を macOS Tahoe 26 で問題なくご利用いただけます。


【EndNote 20 以下】
EndNote 20 以下のバージョンにつきましては今後も正式対応の予定はございません。
OS アップデートに伴う不具合に関しては、サポート対象外となります。

macOS Tahoe をご利用の場合は EndNote のアップグレードをご検討ください。

以上
(https://www.usaco.co.jp/endnote/topics.html?itemid=2561&dispmid=641&srsltid=AfmBOooYSetdJ3DDBxkW4N63-INWOGcqu-P5qvabpecm_GtbNUQmbg1V)

今、メインで使っているMacbook ProではEndNote X9が入っていて、今回のmacOS Tahoe 26が最後のOSになるんだけど……macOS Tahoe 26にアップデートしない方がいいのかなぁ?
さすがにEndNoteをこのタイミングで買い直すのは大変アホらしいと感じます。

javascriptでJSONが読み込めない問題をどうするか?


ちょっとwebサイトをいじる機会があったのですが「file://〜なんかpath〜/index.html」を開いてそこで

fetch("data.json") 

を実行してもほぼ全てのブラウザーでCORSエラーで動きません。
これは「ローカルファイルを勝手に読み込まれては危ない」からほとんどのブラウザーの仕様でそうなっています。
これではローカル環境で動作チェックができないので、別の方法を考える必要があります。

ローカルサーバーを立てればいい

ローカルで簡単にテストしたいときはローカルサーバーを立てるのが定番です。

  1. Pythonの簡易サーバーを使う
  2. Node.jsの簡易サーバーを使う

Node.jsはあまり使わない関係でPythonで説明します

Pythonでローカルサーバーを立ち上げるためには

VSCのターミナルに

# 作業ディレクトリに移動して
python -m http.server 8000

と入力すると作業ディレクトリー上にサーバーが立ち上がります。
あとはブラウザで「http://localhost:8000/index.html」にアクセスするとjsonファイルを読み込むことができます。

サーバーを止める方法

不要になったら control+Cをターミナルにいれることでサーバーは止まります。

数字型を文字列にする時は地味にめんどくさいよねという話


みなさん、お馴染みの

destring var, replace
tostring var, replace

ですが、ラベルのついた数字型の列を文字列に置換する時に地味にめんどくさいことが起きます。

  • 数字ラベルのあるデータは直接文字に置換できない
  • 作戦を考える
    • 1. ラベルを剥いで置換する場合
    • 2. 新しい変数に置換する
    • 3. decodeを使ってラベル名を文字列に使う
  • まとめ
続きを読む