Displaying 20 results from an estimated 3000 matches similar to: "Calling plot with a formula, from within a function, using ..., and xlim"
2007 Dec 22
2
Understanding eval
After many hours of debugging code, I came to the conclusion that I
have a fundamental misunderstanding regarding eval, and hope that
someone here can explain to me, why the following code acts as it does:
foo <- function(expr) {
eval(substitute(expr), envir=list(a=5), enclos=parent.frame())
}
bar <- function(er) {
foo(er)
}
> foo(a)
[1] 5
> bar(a)
Error in eval(expr,
2005 Sep 28
1
boxplot and xlim confusion?
I have some code as shown below. Basically, I would like three
boxplots to be set next to each other with no ylabels on the two
"inner" plots, and I want the same x axis range on all three. However,
it seems like boxplot does not respect the xlim setting. I've tried
the various ways I thought would work (par, boxplot(...xlim=)) but
none of them seem to work. I then tried plot.window,
2003 Aug 25
1
setting xlim and ylim with asp=1
In plot(), when using option asp=1 the xlim and ylim have no effect because
they are changed
changed in order to fill the whole plot region. Is there a way to
automatically set
xlim and ylim when asp has been set to 1?
For example:
#This is a box of the plot ranges I want:
boxxy=rbind(c(-1,2),c(-1,-1),c(1,-1),c(1,2),c(-1,2))
#Without asp=1 I get what I want (i.e. I can't see the box because it
2007 Feb 22
1
Cross-tabulations next to each other
I have the following relatively simple problem. Say we have three
factors, and we want to create a cross-tabulation against each of the
other two:
x <- factor(rbinom(5, 1, 1/2))
y <- factor(rbinom(5, 1, 1/2))
z <- factor(rbinom(5, 1, 1/2))
table(x,y)
table(x,z)
This looks like:
y
x 0 1
0 2 0
1 1 2
z
x 0 1
0 1 1
1 2 1
I would like to get (surely this will
2007 Mar 01
2
R code for "Statistical Models in S" ?
I just acquired a copy of "Statistical Models in S", I guess most
commonly known as the "white book", and realized to my dismay that
most of the code is not directly executable in R, and I was wondering
if there was a source discussing the things that are different and
what the new ways of calling things are.
For instance, the first obstacle was the solder.balance data
2008 May 20
5
Alignment of axes intersection
All,
Very basic question I can't seem to find the answer to:
plot(0:10, 0:10)
The axes intersection is not aligned at (0,0) in the lower left.
How does one force this?
I searched for graphical parameters under par(graphics) but can't seem to
find it.
Thanks!
David
2007 Jan 14
4
Controlling size of boxplot when it is added in a plot
Greetings,
I am trying to add a boxplot to the bottom of a histogram, right
between the histogram bars and the x axis. Here is the code I am
using at the moment (the par line is probably not relevant for our
discussion):
hs <- hist(x, breaks = 20, plot = F)
par(mar = c(3,3,2,1))
hist(x, breaks = 20, main = NULL, ylim = c(-2, max(hs$counts)))
boxplot(x, horizontal = T, axes = T, add =
2008 Mar 10
3
Weighting data when running regressions
Dear R-Help,
I'm new to R and struggling with weighting data when I run regression. I've
tried to use search to solve my problem but haven't found anything helpful
so far.
I (successfully) import data from SPSS (15) and try to run a linear
regression on a subset of my data file where WEIGHT is the name of my
weighting variable (numeric), e.g.:
library(foreign)
2007 Dec 17
3
Cannot grasp how to apply "by" here...
I have a data frame named "database" with panel data, a little piece
of which looks like this:
Symbol Name Trial Factor1 Factor2
External
1 548140 A 1 -3.87
-0.32 0.01
2 547400 B 1 12.11
-0.68 0.40
3 547173 C 1
2007 Nov 07
3
Indexing, and using an empty string as a name
Hello all,
I ran into the following, to me unexpected, behavior. I have (for
reasons that don't necessarily pertain to the question at hand, hence
I won't go into them) the need/desire to use an empty string for the
name of a vector entry. Perhaps I did not read ?"[" very carefully,
but it seems to me that he following lines should return "1" at the end:
2006 Nov 08
6
Making a case for using R in Academia
Hello, new to the list, first message.
This question perhaps might be more appropriate to R-sig-teaching,
and I'd be happy to take it there if this is not the right place for it.
I am teaching applied statistics at a small liberal arts college with
limited resources, and we are currently using SPSS for our courses.
Mainly the reason for this, as I understand it, is that this is what
2008 Jun 12
2
numbers as part of long character
Hi,
I'm looking for some way to pick up the numbers which are contained and buried in a long character.
For example,
outtree.new="(((B:1204.25,E:1204.25):7581.11,F:8785.36):8353.85,C:17139.21);"
num.char =
2007 Jun 26
4
boxplot and bxp do not respect xlim by default (PR#9754)
Full_Name: Steve Ellison
Version: 2.4.1
OS: Windows, Linux
Submission from: (NULL) (194.73.101.157)
bxp() allows specifcation of box locations with at=, but neither adjusts xlim=
to fit at nor does it respect xlim provided explicitly.
This is because bxp() now includes explicit xlim as c(0.5, n+0.5), without
checking for explicitly supplied xlim (or ylim if horizontal).
This also prevents
2008 Apr 29
2
help text for xlim
Dear R-developers,
A student asked me today of how to specify the limits of the x-axis. I
knew that he should use xlim, but I tried to encourage him to have a try
himself with the various help functions. I do not judge if he used the
correct search strategy or right key words, but anyway here is what he
tried: he looked at ?plot. There xlim is not mentioned. He checked ?par.
There you find
2008 Jan 22
1
R: determinants and inverses
hello all
sorry for the following "none" R related question.
does anyone know of a reference to calculate the following identity:
|I + ABC|
where I is an identity matrix and A, B,C may not have to be square matrices?
you help will be greatly appreciated.
H. V. Henderson; S. R. Searle
SIAM Review, Vol. 23, No. 1. (Jan., 1981), pp. 53-60.
provides a result to
2007 Oct 19
1
Manual recycling of vectors?
Sorry if this is already answered somewhere, but I could not find it.
I have two vectors, x,y, of different length, and I want to recycle
the smaller one (whichever one it is) until they have the same
length. I was wondering if there is a anything better than something
like:
x<-1:3
y<-1:10
x<-rep(x,length=max(x,y))
y<-rep(y,length=max(x,y))
or some variant of that using if to
2007 Nov 01
1
Rcmdr Plugin and menus.txt
Hi all,
I'm trying to write a plugin for R Commander, following the model of
the TeachingDemos plugin. I am struggling trying to even add items by
editing the menus.txt file. I would welcome any help from anyone who
has messed with it. Essentially the problem I am having is: I cannot
create a submenu to a newly created menu. Here is what the menus.txt
file looks like:
# type
2008 May 02
1
Phil Spector's book
Since we're on the topic of book reviews, I just received Phil Spector's
new R book called "Data Manipulation with R" and it is also quite a
nice book. I haven't gone through it all and I won't give a detailed
review but I have gotten a lot out of the first 100 pages that I have
read.
Note that I've been using R for almost 1.5 years so , for me, it's a
2012 Jan 08
2
need help with axis ticks
hi,
i am using par(mrow=c(6,6)) function to get 6x6 plots on one screen. the
problem that i am having is that the axis tick labels are far away from the
ticks and going into previous plots (see attached figure). i need to know
how can i reduce the distance between the ticks and their values (y axis
values).the part of the code that i am using (after reading in the data) to
create the top row is:
2007 Dec 14
4
rcom close Excel problem
Hello,
I just discovered that I cannot close the Excel application and task
manager shows numerous copies of Excel.exe
I tried both
x$Quit() # shown in the rcom archive
and
x$Exit()
and Excel refuses to die.
Thank you very much.
S.
"You can't kill me, I will not die" Mojo Nixon
I also have a problem with saving. It produces a pop-up dialog and
does
not take my second