R packages not working accordingly

Dear Community,

When I open Rstudio on my macbook I always got an request from R-studio to install/alter my settings regarding development tools (or something like that). I never installed it because studio was working fine. But today is used the fix() command and then it gave the request to alter the settings again. Which I did but now the packages aren't working properly anymore. I get weird errors when using (for example) the plot() command:

dataset <- read.csv(file.choose(), header = TRUE, sep = ";")

attach(dataset)
plot(Age, LungCap)
Warning message:
In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion.

Before I never got a warning or an error and the plot only show a view variables. Before it showed all 725 variabels.

Also the lm() command:

lm(Age ~ LungCap)

Call:
lm(formula = Age ~ LungCap)

Coefficients:
(Intercept) LungCap1,025 LungCap1,125 LungCap1,175 LungCap1,325
3.000e+00 -1.404e-13 1.000e+00 6.156e-13 2.000e+00
LungCap1,45 LungCap1,575 LungCap1,625 LungCap1,675 LungCap1,775
1.077e-14 3.000e+00 5.000e+00 5.601e-13 4.000e+00
LungCap1,85 LungCap1,9 LungCap1,925 LungCap1,95 LungCap10
5.000e+00 5.000e+00 2.000e+00 4.000e+00 1.500e+01
LungCap10,025 LungCap10,05 LungCap10,1 LungCap10,125 LungCap10,175

(deleted the other items)
Before it just showed two coefficients: one for LungCap and one for Age.

Also issues with lm.fit.

I do not have these issues when I import the data with the function import dataset in the section environment.

Can someone please help?

With kind regards,
DataMagic

the fix function changes functions in your current workspace, so restart R (without saving and restoring workspaces) and R will be as normal

Hello nirgrahamuk,

I did not save the rscript in Rstudio. Unfortunately
the problem isn't fixed. I read something about: Resetting RStudio Desktop's State. Does that help?:slight_smile:

I read this code for resetting:

defaults delete com.rstudio.desktop

Thank you for your respons!

Go to rstudio options. Disable restoring rdata on start.
(https://support.rstudio.com/hc/en-us/article_attachments/202195257/Screen_Shot_2015-06-25_at_4.54.27_PM.png)
Restart R with ctrl shift f10 (at least on windows)

It did not work, but I did import the data again and saw that all the numeric items looked like this: " 16,6" "18,8" etc. And might no be identified as an numeric variabel. Which is odd because it did not do that before and in the excel dataset there all recognized as numbers (see below for print screen)

print screen dataset in R

This is really odd....but thank you anyways:)

OMG there is a read.csv2 and that one works:) i'm so happy. Time to go to bed:)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.