missing R Data Editor window with RStudio on Mac - r

I am learning R with RStudio on Mac. When trying the following code:
mydata <- data.frame(age=numeric(0),
gender=character(0), weight=numeric(0))
mydata <- edit(mydata)
if I use R(GUI) on Mac, it works fine.
R data editor popup from R on Mac
But if I run the same code from RStudio on the same Mac, there is no window and the RStudio is stuck.
Anybody can help?

R studio doesn't support edit function. Instead you can use library like 'editData' (https://cran.r-project.org/web/packages/editData/README.html).

Related

MessageBox in R

I would like to create a messagebox using R. A short research suggested the tcltk package. The tcltk::tk_messageBox() command actually worked the first time I tried it.
However, I then I updated to Windows 10, switched to R 3.4.3, using RStudio v1.1.423. Now the same command does not work, actually terminating the R Session. A second research showed that this is indeed an issue other users have experienced as well.
So, here is my question: Is there either a way to resolve the compatibility issue of the tcltk library and R/RStudio? Alternatively, is there another package that could produce the same result? (I would like to avoid going as far as shiny, that has been suggested)
With Windows 7, R 3.4.3 and RStudio 1.1.423 I have a similar problem, it looks like RStudio hangs, but in fact, the message-box has popped up, just that it does not become the active window and I have to minimize RStudio to see it.
The command I am running is:
tcltk::tk_messageBox(caption = "Hi", message = "what?", icon = "info", type = "yesno")

R doesn't recognize Latin7 characters

I have really strange problem. I am using Lithuanian keyboard, but R doesn't recognize letters such as į, š, č.
For example when I write:
žodis <- "žibutė"
in R console I see
þodis <- "þibutë".
I have R in several computers, all work fine except this one. Can you help me with this issue? Is any function to let R know that I'm using Lithuanian keyboard? My computer's operating system is Windows 10 and R version 3.3.2.

RStudio notebook does not show data.frames when I compile

I have a temporary windows 7 laptop (32 bit) on which I have R 3.3.2 and RStudio 1.0.44.
I am using RStudio notebook, and it works fine when I execute code in its window. However, as I compile to html (pressing Preview), the data.frames disappear (there is a chunk with no output). Everything else (vectors or figures) are shown.
It seems to be linked to the new cute printing format for data.frames that the notebook exploits. Indeed, if I use R-markdown (switching to output: html_document), the data.frames are shown with no problem in the basic R format.
Any help is appreciated.
For the ones having this problem, it turned out the issue was related to rmarkdown 1.2.
I solved installing rmarkdown 1.1:
remove.packages("rmarkdown")
library(devtools)
install_version("rmarkdown", version = "1.1",
repos = "http://cran.us.r-project.org")
Then everything worked.

Unable to get plots displayed in Rstudio graphical viewer.

When I run my code all my graphs (both ggplot2 and plot) are displayed in an external "Quartz 2 [*]" graphical viewer.
I would like them to be displayed in the R studio GUI plot area to I can better save and view my files, along with the previous versions.
Is there anyway to stop this?
I recently updated my version of R, along with the X11 and xQuartz on my mac (also up to date), and I am guessing these updates are behind it.
I have seen many forums explaining how to get rstudio to export to an external viewer (e.g. "quartz()"), but not the other way.
I have looked, but these threads have not helped:
ggplot plots in scripts do not display in Rstudio
plot panel does not produce plots Rstudio
dev.off() even when hidden hide <- dev.off() is not working either.
Any help would be great,
Thanks.
If you upgrade R without upgrading RStudio, the graphics engine may not be compatible. To fix the "Quartz 2" popout, upgrade RStudio to a newer version that supports the graphics engine in the version of R you have installed.
I had the same problem, and noticed the following output to the console:
Warning message:
R graphics engine version 15 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
Looks like I forgot to reinstall Rstudio as well.. That sorted my problem.

R View() function does not show data frame

I am using R (Version 3.1.2) with RStudio (Version 0.98.1091) on a Linux Ubuntu machine. I have a csv file loaded in variable:
rr <- read.csv("/home/user/seconds.csv")
When I call View(rr) I expect to open a new tab and display the CSV data in the rr variable. However, it opens a new tab called rr and it displays the following message.
/content?title=rr&file=94af460bd6644d3aaac734d585046c4f.htm not found
The View function is from package 'utils' which is not supported by the version of R you are using.
I am on a x86_64-w64-mingw32 system with R version 3.4.1, but I want to share a simple solution to get View working again in my case.
Following the step 4 of advice from Tian on Rstudio support (https://support.rstudio.com/hc/en-us/community/posts/115007743908-The-Rstudio-view-not-work-just-blank-), I entered:
install.packages("dplyr", dependencies = TRUE)
Now it works.

Resources