簡體   English   中英

R無法使用cfa()打開文件

[英]R cannot open file with cfa()

立即嘗試完成驗證性因素分析。 已經閱讀了本教程,但無法克服fit命令后出現的以下錯誤:

Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") : cannot open file ' independence =~ x1 + x2 + x3 + x4
          therapies =~ x5': No such file or directory

我正在使用的代碼:

df <- data.frame(df.raw)
carl.model <- ' independence =~ x1 + x2 + x3 + x4
                therapies =~ x5 + x6'

fit <- cfa(carl.model, data=df)

summary(fit, fit.measures = TRUE)

重新啟動和清除工作空間解決了此問題。 我沒有對上述代碼進行任何更改,現在可以正常運行了。

這是因為您有另一個具有相同功能的庫。 指定您正在談論lavaan

lavaan :: cfa(carl.model,data = df)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM