sem-in-r / seminr

Natural feeling domain-specific language for building structural equation models in R for estimation by covariance-based methods (like LISREL/Lavaan) or partial least squares (like SmartPLS)
58 stars 19 forks source link

Installation Error in parse "...seminar/R/boot_utils.R:31:45: unexpected input" #301

Open geshirkey opened 1 year ago

geshirkey commented 1 year ago

Hello seminar community,

I have not yet found a solution as to why the installation of seminar is unsuccessful. Looks like there is an unexpected back-slash in the boot_utils.R file lines 31:45. See the console error message below:

error_seminr

Perhaps someone has a recommendation? I am using the latest version of R Studio, am on a local directory and have tried both direct .tar installation and CRAN #installations. Any help is greatly appreciated.

Thanks!

~Gabriela

soumyaray commented 1 year ago

Hi @geshirkey can you tell us what version of R language (not just the RStudio application) you are using? You can find out using the R command R.Version()$version in the console.

I took a look at the offending lines of code. I'm sorry that it will only run on versions of the R language 4.1 and higher. This should not be the case -- we wish to support older versions of R as well, but we accidentally used notation that only works on R 4.1+.

You can resolve the issue by upgrading your version of the R language (RStudio is a separate studio application that uses R). To update R, you can either reinstall it from its website, or use the installr package to update R from within RStudio.

If you reinstall R from its website, you will unfortunately have to reinstall all the packages you use in all your projects when you need them, as the new version of R will not retain your old packages. If you use installr, it should ask if you want to copy all your old packages to the new version of R on your computer.

In future updates of seminr, we will ensure that it will support older versions of R as well. Sorry for the inconvenience and do let us know if you have more questions or face difficulties.

geshirkey commented 1 year ago

Thank you @soumyaray! This was indeed the issue, as I was using a version <4.0. I am glad it was a simple fix and am grateful for your quick help.

If others find this helpful, I did need to update R to the latest version using the GUI and installr. Then I updated again the RStudio, even though the UI said there were no updates, to a development version so that the Graphics 15 could be used and enable my Plots tab. See that other issue here: https://community.rstudio.com/t/rstudio-not-compatible-with-r-graphics-engine-version-15/124456

After that, seminr V2.3.1 is easily installed!

geshirkey commented 1 year ago

Thank you, Soumya.

I was using a version of R <4.0, specifically 3.4. I had not thought to update R, but was updating only RStudio.

I replied in the thread as well. Thanks again!

~Gabriela

From: Soumya Ray @.> Sent: Friday, August 12, 2022 11:42 AM To: sem-in-r/seminr @.> Cc: Shirkey, Gabriela @.>; Mention @.> Subject: Re: [sem-in-r/seminr] Installation Error in parse "...seminar/R/boot_utils.R:31:45: unexpected input" (Issue #301)

Hi @geshirkeyhttps://urldefense.com/v3/__https:/github.com/geshirkey__;!!HXCxUKc!zbMukOD5u51PC3MaH8M8m6ApjwZXV5CiFzGOoLA7O5IrcupvJQkryMHMuIa4FrGLDoWFv-hj6i0K5H5c9qWyLS_X$ can you tell us what version of R you are using?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/sem-in-r/seminr/issues/301*issuecomment-1213250518__;Iw!!HXCxUKc!zbMukOD5u51PC3MaH8M8m6ApjwZXV5CiFzGOoLA7O5IrcupvJQkryMHMuIa4FrGLDoWFv-hj6i0K5H5c9qQYaE11$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AIUAMFS55S3GCL7JQZN5LUTVYZWFRANCNFSM56L2NMBQ__;!!HXCxUKc!zbMukOD5u51PC3MaH8M8m6ApjwZXV5CiFzGOoLA7O5IrcupvJQkryMHMuIa4FrGLDoWFv-hj6i0K5H5c9hHd30wq$. You are receiving this because you were mentioned.Message ID: @.***>

soumyaray commented 1 year ago

@geshirkey great to hear you got it fixed! It seems the latest version of R you installed is a bleeding-edge development version (not quite finalized yet) so RStudio needed to also install a development version of itself to support the plotting window. Thank you for bringing this to our attention -- it might affect users of not just seminr but everyone.

If you are curious what is 'new' in R in v4.1 and v4.2, then take a look at these: https://www.r-bloggers.com/2021/05/new-features-in-r-4-1-0/ https://www.r-bloggers.com/2022/04/new-features-in-r-4-2-0/

Main thing for most of us is that there is a new 'pipe' notation and a shorter way to define 'anonymous functions'. Enjoy!

BTW, I'm keeping this issue open to remind us to revert our code to support older versions of R (note @NicholasDanks)