Displaying 20 results from an estimated 1000 matches similar to: "lattice x(y)lab and expression"
2002 Apr 22
2
lattice help
I'm new to lattice and can't figure out what the problem is with the
following example:
#########################
> library(lattice)
Loading required package: grid
Attaching package `lattice':
The following object(s) are masked _by_ .GlobalEnv :
xyplot
The following object(s) are masked from package:base :
levels
> test.data <- data.frame(x=rnorm(100),
+
2009 Jan 15
1
Confidence Intervals for Poisson
Hi folks!
I run the following code to get a CI for a Poisson with lambda=12.73
library(MASS)
set.seed(125)
x <- rpois(100,12.73)
lambda_hat<-fitdistr(x, dpois, list(lambda=12))$estimate
#Confidence Intervals - Normal Approx.
alpha<-c(.05,.025,.01)
for(n in 1:length(alpha)) {
LowerCI<-mean(x)-(qnorm(1-alpha[n]/2, mean = 0, sd =
1)*sqrt(var(x)/length(x)))
2010 Jan 03
3
R2HTML Report number format, or Better Way?
Here I am again with question I'll feel foolish for asking, when I
see the answer.
I'm trying to produce a report and here's where I get stuck:
How do I get R2HTML to produce the same number format?
Particularly remove the decimal places for Par and Sal.
Are there better methods to produce this type of report?
Thanks,
L.A.
R version 2.10.0 XP
2005 Jul 11
2
building packages on Windows
Hi, all,
I just recently upgraded my computer though I'm using the same OS (XP).
But now I'm having difficulty building packages and I cannot seem to
solve the problem. I'm using R-2.1.1pat on Windows XP.
Here is what I tried:
D:\Users\sundard\slib\sundar\R>R CMD CHECK sundar
* checking for working latex ... OK
* using log directory
2000 Jul 05
2
couldn't find function "..."
Hi,
R 1.0.1, on Linux(mandrake/RedHat).
I am trying to write my first function using R and I need help figuring
out the error I have indicated in the Subject line above. The purpose
of the function is not to "wow" anyone, but just to serve as a stepping
stone so that I might write more complicated functions in the future.
First I created my function named "CIfunc" and saved
2007 Jun 06
3
string overflow in rpcclient add "printer" driver command
Hello,
I get the folowing error msg in rpcclient -c 'adddriver' command:
ERROR: string overflow by 1 (1024 - 1023) in safe_strcpy [adddriver "Windows NT x86" "My Driver Name 001:aaa]
Printer Driver My Driver Name 001 successfully installed.
My command is like this:
rpcclient MYSRV -s /etc/samba/smb.conf -A auth.txt -c 'adddriver "Windows NT x86" "My
2005 Oct 29
1
Problem with llines in lattice
Dear r-help list members,
I'm experiencing problems getting type="b" (or "o" or "c") to work in
llines(). Try, e.g., the following scaled-down example:
x <- factor(c("a", "b", "a", "b"))
y <- c(1,2,1,2)
z <- factor(c("A", "A", "B", "B"))
symbols <- 1:2
lines <- 1:2
2002 Apr 25
2
install a package from CRAN
Hi,
I've tried to install package "tseries" on my computer (on Windows) but it
doesn't work so far. I have Perl but no compilers (C or Fortran) installed.
So could anyone who happens to have them please mail me the binaries?
Many thanks in advance,
Sonchawan
_________________________________________________________________
2002 Apr 30
3
A sample question
Hello.
Given a vector 1 3 4 2 8 9 5
I want to obtain a vector with all 0 except in the second position and in
the fifth, where the numbers are the same of the first vector.
The new vector must be
0 3 0 0 8 0 0
Thank you very much.
Excuseme but my mind is out of order.
Alessandro
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2002 Apr 15
3
Greek in text()
I have gone over the examples and can't figure this out:
rho<-.77
text(x=.05,y=.5,paste(expression(rho),rho))
I was hoping to get this to print a Greek rho with 0.77 beside it.
Instead I get: rho 0.77 (i.e. Roman lettering)
The help on expression() is quite opaque so I don't understand how it
works.
Thanks for any help.
Bill Simpson
2010 Nov 24
2
Create new string of same length as entry in dataframe
I suspect that this is simple, but thanks in advance for any advice...
I have a dataframe, t2:
V1 V2
aaa 3
aaaa 4
aaaaaa 6
a 1
aa 2
V2 is the length of the string in V1 using nchar(as.character(t1$V1))
I'd like to create a third column, that contains a string of the length of
V2, but containing an alternate text, e.g.
V1 V2 V3
2002 May 06
3
Using Object's Name in Function
Hi,
Suppose I have a function:
myfunc <- function(x, y) {
...
}
And within the function I want to print out the name of the x, y
vectors. For example, if I do:
> myfunc(foo, goo)
[1] "foo" "goo"
It shall return "foo", "goo" (with or without quotes is fine), where foo
and goo are two vectors with numbers.
I know this sounds strange, but I'd
2002 May 03
2
delete rows
Hello,
I would like to know how to delete some rows?
Suppose I have a large data frame look something like this:
x1 x2 x3 ..............
a 1 0.45
b 1 0.41
c 0 0.43
a 1 0.39
d 1 0.40
e 0 0.41
r 1 0.42
a 0 0.46
. . ..
I would like to have another data frame which has all
2002 May 06
3
function sort.list()
Derar R-people
I have troubles understanding what the function sort.list() is doing. On
the homepage it says that it returns a permutation which rearranges a
vector into ascending or descending order (like order() but on a vector
instead of a sequence).
> sort.list(c(0, 2, 10, 11, 4))
[1] 1 2 5 3 4
which does not make sense to me.
In fact I am getting the same (non-sensical) result using
2007 Sep 07
1
contourplot lines, text, and mtext
If I have a contourplot (in the lattice package) and I want to add
straight lines to it, how do I do this?
I see that there are llines() and lsegement() functions for lattice
plots, but they don't seem to do anything in this case:
library(lattice)
library(KernSmooth)
x=rnorm(10000)
y=x+rnorm(x,0,.5)
a=bkde2D(cbind(x,y),.7)
z=as.vector(a$fhat)
grid=expand.grid(x=a$x1,y=a$x2)
grid$z=z
2002 Apr 19
4
Multidimensional scaling
A student of mine wants to use R to do some nonmetric multidimensional
scaling. According to the R FAQ, there's a package called pcurve that
computes multidimensional scaling solutions, but I was not able to locate
it the contrib page (I am a Windows user with R version 1.4.1). Can
anyone tell me whether it is possible to do nonmetric multidimensional
scaling with R, and if so, how?
John
2007 Sep 03
3
plotting predicted curves with log scale in lattice
Hi,
I was taken off guard by the following behavior in a lattice plot.
I frequently want to add a predicted curve defined at more
points than in the formula expression of xyplot. There have
been numerous examples of how to do this on r-help, but I
still often struggle to make this work. I just realized that
specifying one of the axes on a log scale does not guarantee
that the added data for a
2008 May 05
2
Finding non disjoint regular expressions
Hello,
Is there any way I can use the gregexpr functions (or a different function)
in a manner that will also return overlapping (i.e. non disjoint) regular
expressions?
For instance, when running gregexpr("AAA","AAAAAA"), I get two matches, one
at position 1 and one at position 4. I'd like to receive 4 matches at
positions 1, 2, 3 and 4.
Thanks,
Schraga
2007 Apr 26
1
xyplot() and controlling panel.polygon()
Dear R-helpers,
How do I tell panel.polygon what greoup and panel it applies to whithin
xyplot(y ~ x | c, groups = g
panel = function(x, y, groups, ...){
panel.polygon(x = xpol[c, g], y = ypol[c, g], default.units
= 'native')
panel.xYplot(x, y, groups, ...)
llines(x = c(1, 6), y = c(-24.283333, 35.941667), lwd = 2, lty =
3, col = 4)
}
x[c, g] and y[c, g] describe
2002 Apr 17
4
union of lists
Hi there,
Given 2 lists of integer vectors, i.e.:
> lista1
$"1"
[1] 1 34 5
$"2"
[1] 2 1
$"3"
[1] 3 10 15
> lista2
$"1"
[1] 1 5
$"2"
[1] 2 1
$"3"
[1] 3 10 29
I want to obtain the union of both, defined
as the union of the vectors, that is
lista.union[[1]] <- union(lista1[[1]],lista2[[1]]):
> lista.union