R Error Could Not Find Function Unit
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow si unit of r the company Business Learn more about hiring developers or posting ads with us Stack
Error: Could Not Find Function "opts" Ggplot
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of
Could Not Find Function R
6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error: could not find function “unit” up vote 73 down vote favorite 8 While trying to modify theme
Could Not Find Function Ggplot
settings this simple code gives the following error: library(ggplot2) theme_nogrid <- theme_set(theme_update( plot.margin=unit(c(.25, .25, .25, .25), "in"),)) Error in do.call(theme, list(...)) : could not find function "unit" R gives me this error for any element that uses 'unit'. Any other settings that do not call 'unit' work fine. I am running R v.2.15.2 (64-bit Windows). I extensively searched online about this problem and found nothing. I appreciate any suggestions to the problem. plot.margin ggplot2 r ggplot2 share|improve this question edited Dec 16 '13 at 18:09 Andre Silva 2,84592245 asked Feb 14 '13 at 22:20 opv 466143 25 require(grid) –Gregor Feb 14 '13 at 22:22 4 ggplot2 now imports grid, as opposed to loading it –baptiste Feb 14 '13 at 22:25 1 Thank you! It worked. –opv Feb 14 '13 at 22:28 1 Same thing happens with lattice. Somebody ought to right an answer so it can get checked. It deserves to be "on the record". –42- Feb 14 '13 at 22:31 Same thing happened with 'methods' too have a look: stackoverflow.com/questions/30266732/… Is it the case that the current version of ggplot (I work with 1.0.1) is importing some packages instead of loading them? I believe a comprehensive answer by someone with a knowledge of the inners of gglot should be in place. –Costas Bouyioukos May 17 '15 at 22:34 add a comment| 1 Answer 1 active oldest votes up vote 71 down vote This is closely related to, although not exactly identical to, arrow() in ggplot2 no longer supported , which says: [the] grid [package] was loaded automatically by previous versions of ggplot[2] (making grid functions visible/accessible to the user); now it's referred to via NAMESPACE imports instead, so you need to explici
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About unit ra Us Learn more about Stack Overflow the company Business Learn more about hiring developers legend position ggplot2 or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack r install package Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error: could not find function … in http://stackoverflow.com/questions/14885150/error-could-not-find-function-unit R up vote 99 down vote favorite 25 I am using R and tried some.function but I got this error message : Error: could not find function `some.function` This question comes up very regularly. When you get the error: could not find function in R, how can you solve it? Thank you in advance for your help. This is meant to be a FAQ question, so http://stackoverflow.com/questions/7027288/error-could-not-find-function-in-r please be as complete as possible. The answer is a community answer, so feel free to edit if you think something is missing. This question is approved on meta: http://meta.stackexchange.com/questions/101892/community-wiki-with-common-error-messages-allowed r function error-handling r-faq share|improve this question edited Apr 25 '14 at 9:44 community wiki 11 revs, 6 users 54%Joris Meys 3 Before you vote to close this question, first read this disussion on meta: meta.stackexchange.com/questions/101892/… –Andrie Aug 11 '11 at 14:14 2 If all else fails, try grepping the source code for base R and your installed packages –nullglob Aug 11 '11 at 14:46 3 @nullglob That seems somewhat extreme :-) –Gavin Simpson Aug 11 '11 at 14:51 um, what is wrong . . . –mdsumner Aug 11 '11 at 15:21 I have a relevant question: stackoverflow.com/questions/23357551/…. In this case, ANY R command fails, but q()! Advice will be greatly appreciated! –Aleksandr Blekh Apr 30 '14 at 9:29 add a comment| 8 Answers 8 active oldest votes up vote 65 down vote accepted There are a few things you should check : Did you write the name of your function correctly? Names are case sensitive. Did you install the packa
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ grid.arrange, grid.layout - legend, global y axis title Hello, I created several plot with ggplot2 dev mode. Now I want to combine the plots in a grid e.g. 2x2 with a fixed size of the output. What I am doing at the moment is: grid.newpage() pushViewport(viewport(layout = grid.layout(nrow=2, ncol=2, widths = unit(c(7.5,6.5), "cm"), heights = unit(rep(5, 2), "cm")))) print(plot1, vp = viewport(layout.pos.row = 1, layout.pos.col = 1)) print(plot2, vp = viewport(layout.pos.row = 1, layout.pos.col = 2)) print(plot3, vp = viewport(layout.pos.row = 2, layout.pos.col = 1)) print(plot4, vp = viewport(layout.pos.row = 2, layout.pos.col = 2)) This is working well so far. The y-axis are for all plots the same so I'd like to have a global y-axis title on the left side. How can that be done using my approach? I also would like to add a global vertical legend for my plots below all plots. The legend should show the to different symbols (same as for the single plots (ggplot2)). I also don't know how to do that. I know that there is the function grid.arrange which can do both things but this isn't working because I am in the dev mode of ggplot. Then I get the error: Error: could not find function "ggplotGrob. I load my libraries the following way: 1) import data 2) load library(gridExtra) 3) load library(devtools) dev_mode(TRUE) library(ggplot2) library(reshape2) 4) produce plots 5) arrange the plots. So what is the best way to proceed? Should I stay with the grid.layout approach and can I get there a global legend and a global y axis title? Or how can I use grid.arrange, define the position of the gobal legend and set the single plot to a fixed size? I hope that wasn't to complicated... /Johannes -- ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code. baptiste auguie-2 Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦