You're right. It's necessary for xyplot though to prevent grouping.
On Mar 20, 2010 10:43 AM, "Dieter Menne"
wrote:
Sundar Dorai-Raj-2 wrote:
>
> Or perhaps more clearly,
>
> histogram(~a1 + b1 + c1, data = aa, o...
Why outer=TRUE? Looks same for me witho
Or perhaps more clearly,
histogram(~a1 + b1 + c1, data = aa, outer = TRUE)
--sundar
On Fri, Mar 19, 2010 at 3:50 PM, Gabor Grothendieck wrote:
> Try this:
>
> histogram(~ values | ind, stack(aa))
>
>
> On Fri, Mar 19, 2010 at 5:44 PM, Santosh wrote:
> > Dear R-gurus
> >
> > aa <- data.frame(a
Here it is.
https://svn.r-project.org/R/trunk/src/nmath/pt.c
--sundar
On Tue, Mar 9, 2010 at 4:24 AM, Ravi Kulkarni wrote:
>
> I have tried looking for the source code for the pt() function in
>
> https://svn.r-project.org/R/trunk/src/library/stats/
>
> and am unable to find it there. Can
What I ended up using was:
cat(unclass(tmp))
--sundar
On Tue, Mar 2, 2010 at 8:58 AM, Berwin A Turlach wrote:
> G'day Sundar,
>
> On Tue, 2 Mar 2010 01:03:54 -0800
> Sundar Dorai-Raj wrote:
>
> > Thanks, Berwin. That works just great!
>
> You are welcome.
&g
Thanks, Berwin. That works just great!
--sundar
On Tue, Mar 2, 2010 at 12:57 AM, Berwin A Turlach
wrote:
> G'day Sundar,
>
> On Mon, 1 Mar 2010 23:46:55 -0800
> Sundar Dorai-Raj wrote:
>
> > Thanks for the input, but I don't want "try" in the Sweave o
Thanks for the input, but I don't want "try" in the Sweave output. I want
the output to look just like it does in the console, as if an uncaptured
error really did occur.
--sundar
On Mon, Mar 1, 2010 at 11:42 PM, Sharpie wrote:
>
>
> Sundar Dorai-Raj-2 wrote:
> >
Hi,
I'm writing a manual using Sweave and I want to be able to print errors from
bad code. Here's an example:
>=
MySqrt <- function(x) {
if (missing(x)) {
stop("'x' is missing with no default")
}
if (!is.numeric(x)) {
stop("'x' should only be numeric")
}
if (x < 0) {
stop("'
Try googling "latticeExtra x.same" for some examples. Here's one:
http://www.mail-archive.com/r-help@r-project.org/msg39048.html
On Wed, Jan 20, 2010 at 9:44 AM, George Chen wrote:
> Hello,
>
> I would like to juxtapose two lattice graphs with common X axes such that
> the X axes line up. I am
Use a list instead of assign then do.call("rbind", thelist).
import.files <- c("a.txt", "b.txt", "c.txt", "d.txt", "e.txt")
imp <- vector("list", length(import.files))
for (i in 1:length(import.files)) {
imp[[i]] <- read.delim(import.files[i], sep = "", header = TRUE)
}
combined <- do.call("
Is texi2dvi in your PATH? What happens if you open a CMD window and
type texi2dvi at the prompt?
--sundar
On Thu, Nov 26, 2009 at 6:14 AM, Wolfgang Raffelsberger wrote:
> Dear all,
>
> I can't get texi2dvi working right. Basically I'd like to convert a .lex to
> .pdf without having to fiddle wit
It's hard to read your code, so I won't comment on your specific
example. So when all else fails read the documentation for
?summary.aov:
They have columns ‘"Df"’, ‘"Sum Sq"’, ‘"Mean
Sq"’, as well as ‘"F value"’ and ‘"Pr(>F)"’ if there are non-zero
residual degrees of freedom.
So if you
ylim = c(0, max(log10(D10$Part.P)))
Make sure you remove any 0s or NAs before computing the max though.
--sundar
On Fri, Nov 20, 2009 at 6:12 AM, helene frigstad
wrote:
>
> Hi,
>
> is there any way to set the ylim range from zero to whatever is the max
> value in that dataset? I am plotting man
tallation,
> because the same thing's worked for me too before but won't do now.
>
> I tried to reinstall it (base), but R says its there already which I
> expected it to be anyway.
>
> I don't quite know where the issue is. Very odd.
>
>
> --On 16 November
Works for me:
x <-
read.csv(url("http://dc170.4shared.com/download/153147281/a5c78386/Testvcomp10.csv?tsid=20091116-075223-c3093ab0";))
names(x)
x[2:13] <- lapply(x[2:13], factor)
> levels(x$P1L55)
[1] "0" "1"
> is.factor(x$P1L96)
[1] TRUE
> sessionInfo()
R version 2.10.0 (2009-10-26)
i386-appl
Did you make the changes before or after starting the device:
library(lattice)
## before doesn't change the settings on the device:
trellis.par.set(plot.symbol = list(col = "red"))
trellis.device(pdf, file = "tmp.pdf")
xyplot(1 ~ 1)
dev.off()
## after does
trellis.device(pdf, file = "tmp.pdf")
tr
?"%in%" says "x" and "table" must be vectors. You supplied
data.frames. So %in% is coercing your today.sequence to a vector using
as.character(today.sequence)
Perhaps you should paste the columns together first:
x <- do.call("paste", c(sequence, sep = "::"))
table <- do.call("paste", c(today.seq
you must have missing values in "data". Try
tapply(data, group, mean, na.rm = TRUE)
If that's not the case, read the bottom of this email about the posting guide.
HTH,
--sundar
On Tue, Nov 3, 2009 at 5:28 AM, FMH wrote:
> Hi,
>
> I tried to use tapply function to find the mean of the data in
Based solely on what you told us, this can be done using eval(parse(text=...))
cmd <- sprintf("mean(%s)", script)
eval(parse(text = cmd))
However, with more context, there may be a better solution. See, for example,
install.packages("fortunes")
library(fortunes)
fortune("parse()")
HTH,
--sunda
Hi, Michael,
Seems like all you need is aggregate and rbind:
x <- aggregate(saw.aggr.data["value"],
saw.aggr.data[c("conversion.type", "filteredID", "metric")],
sum)
x$bucketID <- "combined"
y <- rbind(saw.aggr.data, x)
Is this what you need?
--sundar
On Mon, Oct
Check to see if you have an old workspace being loaded. You might have an
object called 'family' which you might need to remove.
--sundar
On Oct 11, 2009 12:15 PM, "romunov" wrote:
Thank you Jorge and Barry for your input.
I've fiddled around a bit and as a result, am even more confused. If I
Another possibility is a very large .RData file in the directory where
you're starting R. You can try
Rgui --no-restore
(I don't have windows, so I'm not sure if this an option with RGui,
though I know it is with R.)
--sundar
On Fri, Oct 2, 2009 at 8:50 AM, Gabor Grothendieck
wrote:
> Its unde
Try ?file.exists.
if (file.exists(fxxx)) {
read.table(fxxx)
} else {
cat("\"", fxxx, "\" is missing\n", sep = "")
}
HTH,
--sundar
On Sun, Sep 20, 2009 at 9:28 PM, jiangrm wrote:
> Trying to import a bunch of data files named like f001, f002, f999. Some
> of the files may be
> missing
I think this ought to work for you:
library(lattice)
set.seed(42)
d <- data.frame(year = c(rep(2007,12), rep(2008,12)),
treatment = rep(LETTERS[1:3], each = 4, times = 2))
d$cover <- rnorm(nrow(d))
d$variable <- rnorm(nrow(d))
xyplot(variable ~ cover | year, d,
panel = fun
ata.frame(time = seq(1, 11, length = 100))
lines(newdata$time, predict(model, newdata))
HTH,
--sundar
On Tue, Aug 25, 2009 at 10:05 AM, Sundar Dorai-Raj wrote:
> Hi, Michael,
>
> I think the SPSS answer is wrong. Your starting values are way off.
> Look at this plot for verification:
Hi, Michael,
I think the SPSS answer is wrong. Your starting values are way off.
Look at this plot for verification:
con <- textConnection("time bod
11 0.47
22 0.74
33 1.17
44 1.42
55 1.60
67 1.84
79 2.19
8 11 2.17")
mydata <- read.table(con, header = TRUE)
close(co
A reproducible example would be nice.
Try grid = FALSE for the first question, though I'm unaware which
lattice plot you are using where the default is TRUE. So I can't
guarantee that will even work.
For your second question, add
par.settings = list(strip.background = list(col = "white"))
to yo
Try
dots <- list(...)
if (length(dots) == 0) {
## do something
}
On Thu, Jul 16, 2009 at 6:46 AM, Thomas Roth (geb.
Kaliwe) wrote:
> Hi,
>
> I was wondering what would be the best way to check if the three dots
> argument contains any arguments (i.e. does ... contain any arguments or not?
> )
>
Look at show.settings() and str(trellis.par.get()). This will show you
what the default settings are. The group colors are set by the
superpose.* elements (e.g. superpose.line is for group lines). To set
them, I usually create a list and pass it to par.settings. For
example,
my.theme <- list(super
You could try:
do.call("rbind", lapply(list.files("path/to/files", full = TRUE), read.csv))
And add more arguments to lapply if the files are not csv, have no header, etc.
--sundar
On Tue, Jun 9, 2009 at 11:18 AM, Erin Hodgess wrote:
> Dear R People:
>
> I have about 6000 files to be read in th
use gregexpr and paste
> aze <- paste(c("a", "z", "e"), collapse = "")
> sequence <- paste(c("a","z","e","r","t","a","z","a","z","e","c"), collapse =
> "")
> gregexpr(aze, sequence, fixed = TRUE)
[[1]]
[1] 1 8
attr(,"match.length")
[1] 3 3
HTH,
--sundar
On Fri, Jun 5, 2009 at 6:22 AM, Ptit_Ble
This error is thrown if the argument to max is either NULL or length zero:
[~] Rscript -e "max(NULL)"
[1] -Inf
Warning message:
In max(NULL) : no non-missing arguments to max; returning -Inf
[~] Rscript -e "max(numeric(0))"
[1] -Inf
Warning message:
In max(numeric(0)) : no non-missing arguments to
You're missing a ")" off end of the first line. You should consider
using an editor (e.g. ESS/Emacs) that does parentheses matching. I
found this in less than 5 sec (less time than I'm taking to write you
a note) by cut and pasting in Emacs.
--sundar
On Tue, May 19, 2009 at 12:52 PM, deanj2k wro
7;bc' command (use Cygwin if on Windows);
>>
>> /cygdrive/c: bc
>> bc 1.06
>> Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
>> This is free software with ABSOLUTELY NO WARRANTY.
>> For details type `warranty'.
>> x=65951
Hi,
I'm wondering if someone has solved the problem of converting very
large integers to hex. I know about format.hexmode and as.hexmode, but
these rely on integers. The numbers I'm working with are overflowing
and losing precision. Here's an example:
x <- "6595137340052185552" # stored as charac
Set the colors in graph.sets and not auto.key.
graph.sets <- list(axis.text = list(cex = 0.65),
par.ylab.text = list(cex = 1.25),
par.xlab.text = list(cex = 1.25),
superpose.polygon = list(col = 3:5))
Then remove the "col = 3:5" from auto.key and barchart
Hi, Ning,
Try: eval(parse(text = expr))
HTH,
--sundar
On Sat, May 2, 2009 at 5:39 AM, Ning Ma wrote:
> Hi,
>
> I am new to R. Can anyone tell me how to evaluate an expression stored
> in a string?
> such as:
>> expr <- "3*5"
> I want to get the result 15.
>
> Thanks in advance.
>
> ___
Use ?is.infinite
inf <- is.infinite(data)
data[inf] <- 0.3 * sign(data[inf])
On Sun, Apr 26, 2009 at 5:44 PM, Nigel Birney wrote:
>
> Hello all,
>
> I have to import numeric data from file but found it contains Infinite
> values which need to be eliminated. I tried to replace them in this way:
>
Try (re)reading ?qqnorm. Use datax = TRUE.
--sundar
On Sun, Apr 26, 2009 at 4:37 PM, Chris_d wrote:
>
> Hi all,
> I have just started using R to produce qqnorm plots. I am trying to
> switch the x and y axes so that the theoretical values are plotted on the y
> axis and my data on the x ax
Because you're not calling trellis.par.set correctly. It should be:
trellis.par.set(par.ylab.text = list(cex = 0.65), par.xlab.text =
list(cex = 0.65))
However, I usually do things like this:
my.theme <- list(par.ylab.text = list(cex = 0.65), par.xlab.text =
list(cex = 0.65))
barchart(..., par.s
strip.names = TRUE, ...)
},
layout = c(3,1))
Not sure how to do this with strip.custom.
--sundar
On Thu, Apr 16, 2009 at 1:20 PM, Sundar Dorai-Raj wrote:
> Try:
>
> z <- cbind(rep(c("BIC", "hist"), each = 150), rep(rep(c(5, 10, 30),
> each = 50),2))
Try:
z <- cbind(rep(c("BIC", "hist"), each = 150), rep(rep(c(5, 10, 30),
each = 50),2))
z <- as.data.frame(z)
z <- cbind(z, runif(300))
names(z) <- c("Method", "sigma", "Error")
z$sigma <- factor(z$sigma, c("5", "10", "30"))
library(lattice)
sigma <- as.numeric(levels(z$sigma))
sigmaExprList <-
Try:
library(lattice)
histogram( ~ height | voice.part,
data = singer, type = "c",
scales = list(y =
list(at = seq(0, 20, 5),
labels = seq(0, 200, 50
HTH,
--sundar
On Fri, Apr 3, 2009 at 2:01 PM, Judith Flores wrote:
>
> Hello,
>
> I need
?predict.glm has no "interval" argument. Perhaps you're thinking of
?predict.lm, which is different.
To get intervals in glm, I've used:
example(predict.glm)
pr <- predict(budworm.lg, se.fit = TRUE)
family <- family(budworm.lg)
lower <- family$linkinv(pr$fit - qnorm(0.95) * pr$se.fit)
upper <- fa
Try converting year to a factor
xyplot(min + max + ave ~ month | factor(year), data = rain.stats, ...)
Also, notice the inclusion of the "data" argument.
HTH,
--sundar
On Tue, Mar 31, 2009 at 6:28 AM, wrote:
>
> I am using windows XP with R 2.8.1
>
>
> I am generating a lattice plot of annua
Could be that you have some sort of ad filter in your browser that's
blocking the video? It appears just fine for me in Firefox 3.
On Mon, Mar 30, 2009 at 3:55 PM, Ted Harding
wrote:
> On 30-Mar-09 22:13:04, Jim Porzak wrote:
>> Next week Wednesday evening, April 8th, Mike Driscoll will be talkin
For the first question, add a groups argument. E.g.
barchart(HSI ~ Scenario | Region, Wbirdsm, groups = HydroState)
Also note that using Wbirdsm$HSI makes your call less readable, so I
added the data argument.
For your second question, setting the key does not set the color
theme. You want to se
y string. Is there a
> workaround or another solution ?
>
> --
> Etienne
>
> Sundar Dorai-Raj a écrit :
>
> Assuming "USER" is defined on your system then
>
> Sys.getenv("USER")
>
> ought to work.
>
> --sundar
>
> On Mon, Mar 16, 20
Assuming "USER" is defined on your system then
Sys.getenv("USER")
ought to work.
--sundar
On Mon, Mar 16, 2009 at 3:04 PM, Etienne Bellemare Racine
wrote:
> I would like to get the name of the user form the system. Is it possible ?
> Something like
> >system.user()
> returning something like
Sorry, I should have
xyplot(AbvBioAnnProd ~ Year | factor(Plot), type = c("b", "r"), pch = 16)
On Mon, Mar 16, 2009 at 6:17 AM, Sundar Dorai-Raj wrote:
> Convert "Plot" to factor:
>
> xyplot(AbvBioAnnProd ~ Year | Plot, type = c("b", "r&quo
Convert "Plot" to factor:
xyplot(AbvBioAnnProd ~ Year | Plot, type = c("b", "r"), pch = 16)
Also note that using the "type" argument with multiple values prevents
the necessity of a custom panel function.
HTH,
--sundar
On Mon, Mar 16, 2009 at 5:54 AM, AllenL wrote:
>
> Hello R friends,
> Simp
hanks.
> But I guess I was looking for something more similar to MatLab, I'm really
> surprised R doesn't have a preset command for this (?)
> Thanks again,
> Stu
> On 11 • Mar • 2009, at 5:49 PM, Sundar Dorai-Raj wrote:
>
> Does this help?
>
> A <- matrix(
Does this help?
A <- matrix(0, 6, 6)
vec <- 1:5
A[row(A) == col(A) + 1] <- vec
--sundar
On Wed, Mar 11, 2009 at 4:42 PM, Stu Field wrote:
> I'm trying to enter a vector into the subdiagonal of a matrix but
> cannot find a command in R which corresponds to the MatLab version of
> diag(vec, k), w
I don't believe Elena's suggestion will work. However, the following will:
xyplot(..., scales = list(y = list(at = seq(5, 25, 5
though you may need to extend the limits a little as well:
xyplot(..., ylim = lattice:::extend.limits(c(0, 30)))
and add the scales argument from the first example
Convert Year to a factor and both problems will be solved.
--sundar
On Tue, Mar 10, 2009 at 3:48 PM, jimdare wrote:
>
> Hi,
>
> I have created the plot below and have a few questions about changes.
>
> 1) How do I change the "Year" title of each plot so it reads from the top
> "2006","2007","200
superpose.symbol = list(
> cex = c(1, 3),
> pch = 19,
> col = c("blue", "red"
>
> And this:
> xyplot(y ~ x, temp, cex = temp$cex, col = temp$col, pch = 19);
>
> Once I introduce groups, I lose the ability to customize ind
Try this:
xyplot(y ~ x, temp, groups = groups,
par.settings = list(
superpose.symbol = list(
cex = c(1, 3),
pch = 19,
col = c("blue", "red"
See:
str(trellis.par.get())
for other settings you might want to change.
Also, you should drop the ";
Hi,
There are possibly several ways to do this. My approach would be:
dates <- strptime(as.character(DATE), "%d%b%Y")
year <- dates$year + 1900
week <- floor(dates$yday/365 * 52)
HTH,
--sundar
On Thu, Mar 5, 2009 at 8:58 AM, Pele wrote:
>
> Hi R users,
>
> I have a factor variable called date
(Sorry for the repeat. Forgot to copy R-help)
Try,
test = data.frame(expand.grid(c(1:10), c(1:10)))
z = test[,1] + test[,2]
test = cbind(test, z)
names(test) = c("x", "y", "z")
require(lattice)
wireframe(z ~ x*y, data = test,
par.settings = list(axis.line = list(col = "transparent")),
par.box =
To reorder the y-labels, simply reorder the factor levels:
df <- data.frame(x_label = factor(x_label),
y_label = factor(y_label, rev(y_label)),
values = as.vector(my.data))
Not sure about putting the strips at the bottom. A quick scan of
?xyplot and ?strip.defaul
The only way I can figure out to do this is to use two calls to
panel.contourplot:
library(lattice)
x <- seq(-2, 2, length = 20)
y <- seq(-2, 2, length = 20)
grid <- expand.grid(x=x, y=y)
grid$z <- dnorm(grid$x) * dnorm(grid$y)
contourplot(z ~ x * y, grid,
panel = function(at, lty, col
Read the help page as to their differences: ?"<-"
On Sat, Feb 21, 2009 at 7:30 AM, Thomas Mang wrote:
> Hi,
>
> Both operators <- and = can be used to make an assignment. My question is:
> Is there a semantic difference between these two? Some time ago, I remember
> I have read that because of so
This is on the Mac FAQ:
http://cran.cnr.berkeley.edu/bin/macosx/RMacOSX-FAQ.html#How-can-R-for-Mac-OS-X-be-uninstalled_003f
HTH,
--sundar
On Tue, Feb 17, 2009 at 7:17 AM, ANJAN PURKAYASTHA
wrote:
> I need to uninstall R 2.7.1 from my Mac. What is the best way to uninstall
> it? Simply delete t
quot;FBG")
On Thu, Feb 12, 2009 at 3:49 PM, Sundar Dorai-Raj wrote:
> Try:
>
> coplot(lbxglu~lbxgh|eth, data = reg.dat.5,
> panel= function(...) {
>panel.smooth(...)
>panel.abline(h = 126, col = "red")
>panel.abline(v = 6.5, col = "blue")
Try:
coplot(lbxglu~lbxgh|eth, data = reg.dat.5,
panel= function(...) {
panel.smooth(...)
panel.abline(h = 126, col = "red")
panel.abline(v = 6.5, col = "blue")
},
xlab="ABC", ylab="FBG")
Also note that you removed your "with" call and give coplot a data argument.
HTH,
--sunda
Try
x <- diag(n)
x[upper.tri(x)] <- 1
On Wed, Feb 11, 2009 at 1:22 PM, Dale Steele wrote:
> The code below create an nxn upper triangular matrix of one's. I'm
> stuck on finding a more efficient vectorized way - Thanks. --Dale
>
> n <- 9
> data <- matrix(data=NA, nrow=n, ncol=n)
> data
> for (
uestion: How can I modify the way the value labels (those
> that are at the end of the bars) appear? Can I make them bold? Make
> them appear a bit to the right or to the left of where they currently
> are?
> Thanks a lot!
>
> Dimitri
>
> On Wed, Feb 11, 2009 at 12:46 PM, Sundar Dor
you can try
lapply(lapply(uniques, function(x) subset(df, date == x)), myfun)
or possibly more accurate (subset may be finicky due to scoping):
lapply(lapply(uniques, function(x) df[df$date == x, ]), myfun)
or use ?split
lapply(split(df, df$date), myfun)
HTH,
--sundar
On Sun, Feb 8, 2009 at
I'm not sure what you really want, so perhaps a simple example would
help (i.e. what a sample of the input looks like and what the output
you need looks like). My guess would be
sapply(df, diff)
but again, I'm not sure.
--sundar
On Sun, Feb 8, 2009 at 4:24 PM, glenn wrote:
> Newbie question so
You're missing that "R_TSConv" is an R object. You can use
stats:::R_TSConv to see the value. Not sure how this helps you though.
On Wed, Feb 4, 2009 at 10:08 AM, wrote:
> Let me get more specific. I think it this can be answered then I can
> translate the information to other calls. In the ari
Try this:
dados <- data.frame(varsep = factor(rep(1:2,10)),
i = runif(20))
library(lattice)
font.settings <- list(
font = 2,
cex = 2,
fontfamily = "serif")
my.theme <- list(
box.umbrella = list(col = "red"),
box.rectangle = list(col
It's always best to do this with list operations (e.g. lapply) rather
than a loop:
DF1 <- split(DF, DF$male)
DF2 <- lapply(DF1, function(x) {
x2 <- t(as.matrix(x[3:5], dimnames = list(levels(x$age), NULL)))
as.data.frame(x2)
})
Then DF2[["0"]] and DF2[["1"]] are the data.frames you want.
HTH
ength.out=n, by = 1),
> SnowLineElevation = runif(n, 0, 100)
>)
> )
> }
>
> xyplot (
> SnowLineElevation ~ Year | Model,
> data = d,
> ylim = c(0,100),
> type = c('p','smooth'),
> col = 'blue',
> pch = 21,
> xlab =
You'll need a custom panel function. It would also help if you
provided a reproducible example:
xyplot (
SnowLineElevation ~ Year | Model,
data = data,
panel = function(x, y, col, ...) {
col <- ifelse(panel.number() == 1, "red", "green")
panel.xyplot(x, y, col = "blue", ...)
pane
need to circumvent output buffering.
See e.g
http://perl.plover.com/FAQs/Buffering.html
Sundar Dorai-Raj wrote:
Hi,
I have an application in perl that prints some output to either stderr
or stdout.
Here's an example:
# tmp.pl
print STDERR "starting iterator\n";
for(my $i = 0;
Hi,
I have an application in perl that prints some output to either stderr
or stdout.
Here's an example:
# tmp.pl
print STDERR "starting iterator\n";
for(my $i = 0; $i < 100; $i++) {
print $i . "\n";
}
# tmp.R
con <- pipe("perl tmp.pl")
r <- readLines(con, n = -1)
close(con)
However,
ntermountain Healthcare
[EMAIL PROTECTED]
801.408.8111
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
project.org] On Behalf Of Sundar Dorai-Raj
Sent: Friday, November 07, 2008 12:43 PM
To: r-help@r-project.org
Subject: [R] determining plot location in lattice
Hi,
Hi,
I'm dealing with a lattice plot inserted into a tk widget and would like
to know when a user has clicked on the plot area of a plot (i.e. inside
the axes). For example,
library(tkrplot)
library(lattice)
tt <- tktoplevel()
makePlot <- function() print(xyplot(1 ~ 1))
printCoords <- function
I solved this problem by adding "exportselection = 0" to the call to
tklistbox. I.e.
tb1 <- tklistbox(tt, listvariable = tcl1,
exportselection = 0,
selectmode = "multiple")
Thanks,
--sundar
Sundar Dorai-Raj said the following on 10/29/
Hi,
I'm posting yet another question about tcltk since I'm still struggling
with the package. I'm trying to create a tklistbox and a ttkcombobox on
the same parent and am having a problem. Here's an example:
library(tcltk)
tt <- tktoplevel()
tcl1 <- tclVar()
tcl2 <- tclVar()
tclObj(tcl1) <- l
now Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
801.408.8111
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
project.org] On Behalf Of Sundar Dorai-Raj
Sent: Monday, October 27, 2008 3:02 PM
To: r-help@r-project.org
Subject: [R] ttkcombo
Hi, all,
(sessionInfo at the end)
I've been struggling with the tcltk package and can't seem to get the
ttkcombobox to work. Here's an example:
library(tcltk)
p <- tktoplevel()
l <- tclVar()
## I don't know if I'm even calling it correctly
cb <- ttkcombobox(p, values = letters[1:4], textvaria
) {x^.(z)})
function(x) {x^.(z)}
bquote(function(x, y) { x^.(z) + y})
function(x, y) { x^.(z) + y}
R.version.string # Vista
[1] "R version 2.7.2 (2008-08-25)"
Try it this way:
z <- 2
f <- function(x, y) {}
body(f) <- bquote({ x^.(z) + y })
eval(f)(2, 3)
On Thu, Oct 2, 20
Hi, R-help,
(sessionInfo at the end)
I'm trying to construct a function using bquote and running into a
strange error message. As an example, what I would like to do is this:
z <- 2
eval(bquote(function(x, y) { x^.(z) + y }))(2, 3)
However, I get the following:
Error in eval(expr, envir, en
Nanye Long said the following on 8/18/2008 3:00 PM:
Hi all,
I want to do plot() in a loop to make 10 graphs, so I have some code like
for (i in 1:10) {
plot(... ... , xlab = expression(g[i]) )
}
I expect g_1, g_2, and so on appear on x labels, but it simply prints
g_i for each graph. Does
Iasonas Lamprianou said the following on 5/2/2007 8:25 AM:
> Hi I am using R version 2.4.1. How can I upgrade to version 2.5 without
> having to install all the packages again?
> Thanks
> Jason
>
You may find the following link relevant.
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/75359
[EMAIL PROTECTED] said the following on 5/14/2008
12:40 PM:
Using R 2.6.2, say I have the following list of lists, "comb":
data1 <- list(a = 1, b = 2, c = 3)
data2 <- list(a = 4, b = 5, c = 6)
data3 <- list(a = 3, b = 6, c = 9)
comb <- list(data1 = data1, data2 = data2, data3 = data3)
So that a
Erin Hodgess said the following on 3/24/2008 10:39 AM:
> Hi again R People:
>
> This works fine:
>> library(tcltk)
>> a <- tclVar("4.5")
>> as.numeric(tclvalue(a))
> [1] 4.5
>> #But if you have:
>> b <- tclVar("pi")
>> as.numeric(tclvalue(b))
> [1] NA
> Warning message:
> NAs introduced by coerc
Park, Kyong H Mr ECBC said the following on 3/14/2008 12:25 PM:
> Classification: UNCLASSIFIED
> Caveats: NONE
>
> Dear R users,
>
> I'm interested in finding a random effect of the Block in the data shown
> below, but 'lme' does not work without the random effect. I'm not sure how
> to group
Andrew McFadden said the following on 3/12/2008 1:47 PM:
> Hi all
>
> I am trying to determine the distances between two datasets of x and y
> points. The number of points in dataset One is very small i.e. perhaps
> 5-10. The number of points in dataset Two is likely to be very large
> i.e. 20,
Or my personal favorite if the length of mySigma is variable:
mySigma <- 2:3
plot(1:10, dnorm(1:10, sd = mySigma[1]), type = 'l')
lines(dnorm(1:10,sd = mySigma[2]),lty = 2)
leg <- as.expression(lapply(mySigma, function(x) bquote(sigma == .(x
legend(x = "topright", lty = c(1,2),legend = leg)
T
Marlin Keith Cox said the following on 2/15/2008 11:39 AM:
> Dear R Users, close to the end of this I used wireframe to create a 3D plot
> from a matrix. The x and y axis tick labels (1-6) for each were created
> from the matrix being a 6X6 matrix. I need the axis tick labels to be the
> row and
[Ricardo Rodriguez] Your XEN ICT Team said the following on 2/12/2008
12:23 AM:
> Hi all,
>
> We are facing a problem while introducing ourselves to Reshape package
> use. Melt seems to work fine, but cast fails when we use mean as
> fun.aggregate. As you see here, length and sum work fine, b
Jon Loehrke said the following on 2/5/2008 2:29 PM:
> Is it possible to place maps onto lattice plots?
>
> With basic plotting you can add a map to a plot
>
> library(lattice)
> long<-c(-69.2, -69.5, -70.1, -70.3)
> lat<-c(41, 41.5, 43.2, 42.8)
> plot(long, lat)
> map('state', c("massachusetts")
Stefan Grosse said the following on 1/11/2008 10:04 AM:
> Dear useR's,
>
> I have a problem with the lattice plotting of some symbols:
>
> library(lattice)
>
> test<-data.frame(x=c(2,3,1,5),u=c(rep(1,2),rep(2,2)),g=c(rep(c(1,2),2)))
>
> xyplot(x~u,groups=g,
> data=test,
> par.settings=list(
[EMAIL PROTECTED] said the following on 1/7/2008 2:59 PM:
> Hello everyone,
>
> I have an overlay plot it's nice but you can't see all the data. I would
> like to know if there is a way to get a plot that gives a side by side
> plot so that each plot would be next to each other. The two plots h
marcg said the following on 1/5/2008 3:48 AM:
> hello
>
> could anyone tell my, why I do not suceed with mfrow?
>
> par(mfrow=c(4,4))
>
> for (i in 5:17){
> levelplot(maxwater[,i]~maxwater$V1*maxwater$V2, col.regions=whiteblue(5),
> xlab="", cuts=4)
> }
>
> Thanks
>
> Marc
> --
>
get(x)
This is a FAQ:
http://cran.cnr.berkeley.edu/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f
--sundar
Shubha Vishwanath Karanth said the following on 12/28/2007 8:38 AM:
> Hi R,
>
>
>
> x="A"
>
> A=5
>
>
>
> I need to get the value of A using x only. How do I do t
francogrex said the following on 11/29/2007 1:00 PM:
> suppose I have this equation:
> (x^2+y^2+3z^3)/(5*z^2*x^3)=0
>
> and I want to find x in relation to the other variables which actually is:
>
> x=sqrt(-3*z^3-y^2) or x=-sqrt(-3*z^3-y^2)
>
> Can R give me this expression solution? I know th
Bert Gunter said the following on 11/15/2007 1:12 PM:
> Folks:
>
> delta <- 1:5
>
> I would like to put 5 separate lines of text of the form "10 %+-% delta[i]"
> into a lattice key legend, where ""%+-%" is the plotmath plus/minus symbol
> and delta[i] is the ith value of delta.
>
> The construct
threshold said the following on 11/3/2007 4:41 AM:
> Hi, my problem belongs to the basic ones. I want to get cumulated sum over
> the matrix columns by one command (if such exists). Ordinary R's cumsum(x)
> when x is:
> [,1] [,2]
> [1,]15
> [2,]26
> [3,]37
> [4,]4
1 - 100 of 111 matches
Mail list logo