if your data set is large.
Stephen P. Ellner ([EMAIL PROTECTED])
Department of Ecology and Evolutionary Biology
Corson Hall, Cornell University, Ithaca NY 14853-2701
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
!!!
Best regrards
Hsin Ya Lee
I don't understand exactly what you want but perhaps start with this:
expand.grid(pH = c(1.2, 7.4), Formulation = c(F, S, MF))
Hope this helps,
Stephen
--
Rochester, Minn. USA
__
R-help@stat.math.ethz.ch mailing list
for a bigger data set
and retain a subset of the predictions.
Hope this helps,
Stephen
--
Rochester, Minn. USA
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R
This seems to work:
tmp - aggregate(DF$y, list(DF$x, DF$f), mean)
tmp2 - aggregate(DF$conc, list(DF$x, DF$f), paste,collapse=, )
names(tmp2)[3] - var1
final - merge(tmp,tmp2)
--- Lauri Nikkinen [EMAIL PROTECTED] wrote:
#Hi R-users,
#I have an example DF like this:
y1 - rnorm(10) + 6.8
vectors, and the structure of
the output is less unpredictable to me if I can figure out which
attributes are potentially modified in the returned object.
I wonder if anyone has additional thoughts on this.
Stephen
P.S. I agree that R/S does have its own peculiarities, but I think having
them
I think you want to use the 'density' argument. For example:
barplot(1:5,col=1)
legend(topleft,fill=1,legend=text,cex=1.2)
par(new=TRUE)
barplot(1:5,density=5,col=2)
legend(topleft,fill=2,density=20,legend=text,bty=n,cex=1.2)
(if you wanted to overlay solid colors with hatching)
Here's the
I'm trying to figure out how to trigger a process from within R. I have an
exectuable file that runs a Fortran model, but ideally, would like to run it
from R. Note that I'm not talking about importing the function at all, passing
variables, or anything complicated like that. I basically just
I think that's the standard presentation for polar plots (theta measured from
positive x-axis) - that I've seen, anyway. But for customization you can
shift your origin for theta and define your own labels. For example, here is
a modification to the example in the help page for polar.plot():
I think you're looking for
parse(text=paste(letters[1:3], collapse=+))
--- Jarrod Hadfield [EMAIL PROTECTED] wrote:
Hi Everyone,
I would simply like to coerce a character string into an expression:
something like:
as.expression(paste(letters[1:3], collapse=+))
but I can't seem to
?try
or
?tryCatch
http://www.maths.lth.se/help/R/ExceptionHandlingInR/
for example...
tryCatch(lme(Y ~ X1*X2, random = ~1|subj, Model[i]),
error=function(err) return(0))
(you can do something with 'err' or just return 0 as above)
--- Gang Chen [EMAIL PROTECTED] wrote:
I run a
On Aug 6, 2007, at 1:44 PM, Stephen Tucker wrote:
?try
or
?tryCatch
http://www.maths.lth.se/help/R/ExceptionHandlingInR/
for example...
tryCatch(lme(Y ~ X1*X2, random = ~1|subj, Model[i]),
error=function(err) return(0))
(you can do something with 'err' or just
try
grep(paste(^,b[2],$,sep=),a)
your version will match b2:
grep(^b[2]$,c(b,b2,b3))
[1] 2
--- Shao [EMAIL PROTECTED] wrote:
Hi,everyone.
I have a problem when using the grep.
for example:
a - c(aa,aba,abac)
b- c(ab,aba)
I want to match the whole word,so
grep(^aba$,a)
it
Not sure exactly what 'results' is doing there or 'barplot(table(i),...)'
does [see ?table]
but I think this is sort of what you want to do?
## Variable assignment
G01_01 - 1:10
G01_02 - 2:6
## Combine to list*
varnames - paste(G01_,substring(100+1:2,2),sep=)
vars -
I think you need
predict(mod,newdate)
instead of
predict(y,newdate)
--- Maja Schröter [EMAIL PROTECTED] wrote:
Hello everybody,
I'm trying to predict a linear regression model but it does not work.
My Model: y = Worktime + Vacation + Illnes + Bankholidays
My modelmatrix is of
methods(plot)
--- Edna Bell [EMAIL PROTECTED] wrote:
Hi R Gurus:
I know that plot has extra things like plot.ts, plot.lm
How would i find out all of them, please?
Thanks,
Edna
__
R-help@stat.math.ethz.ch mailing list
?cumsum
--- zahid khan [EMAIL PROTECTED] wrote:
I want to calculate the commulative sum of any numeric vector with the
following command but this following command does not work comsum
My question is , how we can calculate the commulative sum of any numeric
vector with above command
p - seq(0.001,0.999,,1000)
x - qt(p,df=9)
y - dt(x,df=9)
plot(x,y,type=l)
polygon(x=c(x,rev(x)),y=c(y,rep(0,length(y))),col=gray90)
Hope this helps.
ST
--- Nair, Murlidharan T [EMAIL PROTECTED] wrote:
Indeed, this is what I wanted, I figured it from the function you and
Mark pointed me.
Thanks to all for the response - the grid.points() solution works well.
Stephen
(oddly I missed when this thread and its response actually got posted... was
starting to get worried)
--- Deepayan Sarkar [EMAIL PROTECTED] wrote:
On 7/31/07, Uwe Ligges [EMAIL PROTECTED] wrote:
Stephen
(x=c(x.tmp[b],rev(x.tmp[b])),y=c(y.tmp[b],rep(0,length(y.tmp[b]))),col=gray90)
Please let me know if I have made any mistakes.
Thanks ../Murli
-Original Message-
From: Richard M. Heiberger [mailto:[EMAIL PROTECTED]
Sent: Thu 8/2/2007 10:25 AM
To: Nair, Murlidharan T; Stephen
try
par(las=1)
plot(0,0,xaxt=n,type=n, ylim=c(0,100))
mtext(35,side=2,at=35)
you can use 'las=1' in par(), plot(), axis(), etc.
more generally, you can use 'srt' in text() to rotate tick labels:
plot(1:10,1:10,xaxt=n,type=n, yaxt=n,ylim=c(0,100))
axis(1); axis(2,lab=FALSE)
is not passed to the R process.
11.Rout only shows processing time and 13.out does not have the value.
Thank you all.
stephen
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
see ?rect, or, for more general shapes, ?polygon
## EXAMPLES
plot(c(0,500),c(0,500),type=n,las=1)
rect(par(usr)[1],200,par(usr)[2],300,col=grey90)
points(seq(0,500,length=3),seq(0,500,length=3))
plot(c(0,500),c(0,500),type=n,las=1)
polygon((par(usr)[1:2])[c(1,1,2,2)],
Hi Conor,
I hope I interpreted your question correctly. I think for the first one you
are looking for a conditioning plot? I am going to create and use some
nonsensical data - 'iris' comes with R so this should be reproducible on your
machine:
library(lattice)
data(iris)
x - iris
# make some
Sorry, just got back into town.
I wonder if AIC, BIC, or cross-validation scoring couldn't also be used as
criteria for model selection - I've seen it mostly in the context of variable
selection rather than 'form' selection but in principle might apply here?
--- Dieter Menne [EMAIL PROTECTED]
I think you are looking for append(), though it won't modify the object
in-place like Python [I believe that is a product of R's 'functional
programming' philosophy].
might want to check this entertaining thread:
http://tolstoy.newcastle.edu.au/R/help/04/11/7727.html
in this example it would be
looking through the documentation for xyplot, panel.points,
trellis.par.set, and the R-help archives. Maybe it goes by another name?
Thanks in advance,
Stephen
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
Here are two simple ways:
=== method1 ===
cat(line1,\n,file=output.txt)
cat(line2,\n,file=output.txt,append=TRUE)
=== method2 ===
sink(output.txt)
cat(line1,\n)
cat(line2,\n)
out - lm(y~x,data=data.frame(x=1:10,y=(1:10+rnorm(10,0,0.1
print(out)
sink()
And then there is 'Sweave'. Check out,
I don't know why it doesn't work but I think people generally recommend that
you use wireframe() in lattice rather than persp(), because wireframe is more
customizable (the pdf document referred to in this post is pretty good):
http://tolstoy.newcastle.edu.au/R/e2/help/07/03/12534.html
Here's an
I think your way is probably the easiest (shockingly). For instance, here are
some alternatives - I think in both cases you have to calculate the
coefficient of determination (R^2) manually. My understanding is that
multiple R^2 in your case is the usual R^2 because you only have one
predictor
Well spoken. And since log transformations are nonlinear and 'compresses' the
data, it's not surprising to find that the fit doesn't look so nice while the
fit metrics tell you that a model does a good job.
--- [EMAIL PROTECTED] wrote:
On 24-Jul-07 01:09:06, Andrew Clegg wrote:
Hi folks,
around that.
--- Stephen Tucker [EMAIL PROTECTED] wrote:
## Data input
input -
Year Count
1999 3
2000 5
2001 9
2002 30
2003 62
2004 154
2005 245
2006 321
dat - read.table(textConnection(input),header=TRUE)
dat[,] - lapply(dat,function(x) x-x[1])
# shifting
know how it was created
originally but may be convenient to reassign names by
names(Monsoon) - make.names(names(Monsoon))
--- Gavin Simpson [EMAIL PROTECTED] wrote:
On Sun, 2007-07-22 at 21:51 -0700, Stephen Tucker wrote:
It turns out that - and (space) are not valid variable names
You could try
par(mar=c(0,5,0,2), mfrow = c(6,1), oma=c(5,0,2,0))
##...then, your plots...##
--- Mr Natural [EMAIL PROTECTED] wrote:
I would appreciate suggestions for removing the white spaces the graphs in
a
stack:
par(mar=c(2,2,1,1), mfrow = c(6,1))
mydates-dates(1:20,origin=c(month
-0.03372794 -0.05874675
Hope this helps,
Stephen
--- Bernzweig, Bruce (Consultant) [EMAIL PROTECTED] wrote:
In trying to get a better understanding of vectorization I wrote the
following code:
My objective is to take two sets of time series and calculate the
correlations for each
-0.8213577 0.371248
mat2col5 -0.001457972 0.03998203 0.4273667 0.526239 0.4390378
--- Stephen Tucker [EMAIL PROTECTED] wrote:
Dear Bruce,
In your functions, you need to use your bound variable, 'x' [not mat1] in
your anonymous function [function(x)] as the argument to cor
Could you post the output from
str(data)
?
Perhaps that will give us a clue.
--- amna khan [EMAIL PROTECTED] wrote:
Sir the station name S.Sharif exists in the data but still the error is
ocurring of being not found.
Please help in this regard.
On 7/22/07, Gavin Simpson [EMAIL
Very close... Actually it's more like
savecol2=sapply(test, function(x) x[,1])
to get the same matrix as you showed in your for-loop (did you actually want
the first or second column?).
when I have multiple complex lists I am trying to manage...
for this, you can try mapply() which goes
...
$ Faisalabad: num [1:56] 79.2 43.9 55.4 ...
$ Lahore: num [1:60] 32.5 81.5 28.7 ...
when I attach the data file and access the site S-Sharif or D-I Khan or
Mian Wali then error messages occur.
Please help in this regard.
Thank You
On 7/23/07, Stephen Tucker [EMAIL
I think you can still read as a table, just use argument fill=TRUE.
Reading from Excel in general: you can save data as 'csv' or tab-delimited
file and then use read.csv or read.delim, respectively, or use one of the
packages listed in the following post (for some reason lines breaks are
messed
, ...)
}
panel.qrect - function(rect.info) {
function(x, y, ...) {
environment(ri) - environment() ###
ri(x, y, ..., rect.info = rect.info)
}
}
xyplot(runif(30) ~ runif(30) | gl(3, 10),
panel = panel.qrect(rectInfo))
On 7/14/07, Stephen
good to know (and cool demonstrations btw). Thanks!
Stephen
--- Deepayan Sarkar [EMAIL PROTECTED] wrote:
On 7/14/07, Stephen Tucker [EMAIL PROTECTED] wrote:
I wonder what kind of objects? Are there large advantages for allowing
lattice functions to operate on objects other than data frames
My apologies, didn't see the boundary constraints. Try this one...
f - function(x)
(sqrt((x[1]*0.114434)^2+(x[2]*0.043966)^2+(x[3]*0.100031)^2)-0.04)^2
optim(par=rep(0,3),f,lower=rep(0,3),upper=rep(1,3),method=L-BFGS-B)
and check ?optim
--- massimiliano.talarico [EMAIL PROTECTED] wrote:
their language...
So, hope you don't mind, but I may ask some more 'can ggplot do this'
questions in the future. But keep up the good work,
Stephen
--- hadley wickham [EMAIL PROTECTED] wrote:
Hi Stephen,
You can't do that in ggplot (have two different scales) because I
think it's generally
f - function(x)
(sqrt((x[1]*0.114434)^2+(x[2]*0.043966)^2+(x[3]*0.100031)^2)-0.04)^2
optim(c(0,0,0),f)
see ?optim for details on arguments, options, etc.
--- massimiliano.talarico [EMAIL PROTECTED] wrote:
I'm sorry the function is
My apologies, I read the post over too quickly (even the second time).
It's been a while since I've played around with anything other than box
constraints, but this one is conducive to a brute-force approach (employing
Berwin suggestions). The pseudo-code would look something like this:
delta -
What's wrong with lattice? Here's an alternative:
library(ggplot2)
ggplot(data=data.frame(x,y,grps=factor(grps)),
mapping=aes(x=x,y=y,colour=grps)) + # define data
geom_identity() +# points
geom_smooth(method=lm) # regression line
Regarding your earlier statement,
I tend to think in very data centric approach, where you first generate the
data (in a data frame) and then you plot it. There is very little data
creation/modification during the plotting itself...
Is the data generation and plotting truly separate and
the scaling a
priori to create a new variable, (2) plotting points from the new variable,
and (3) creating a new axis with custom labels. Which then brings me back to
...how to add new guides? :)
Thanks,
Stephen
This should do it:
allData - sapply(paste(Sim,1:20,sep=),
function(.x) read.table(paste(.x,txt,sep=.)),
simplify=FALSE)
see ?read.table for specification of delimiters, etc.
allData will be a list, and you can access the contents of each file by
any of the
I wonder what kind of objects? Are there large advantages for allowing
lattice functions to operate on objects other than data frames - I
couldn't find any screenshots of flowViz but I imagine those objects
would probably be list of arrays and such? I tend to think of mapply()
[and more recently
(panel.qrect, list(rect.info = rectInfo)))
The createWrapper approach does have an advantage in the situation
where the function analogous to panel.qrect is existing since using
scoping then involves manipulation of environments in the closure
approach.
On 7/11/07, Stephen Tucker [EMAIL PROTECTED
Not that Trellis/lattice was entirely easy to learn at first. :)
I've been playing around with ggplot2 and there is a plot()-like wrapper for
building a quick plot [incidentally, called qplot()], but otherwise it's my
understanding that you superpose elements (incrementally) to build up to the
In the Trellis approach, another way (I like) to deal with multiple pieces of
external data sources is to 'attach' them to panel functions through lexical
closures. For instance...
rectInfo -
list(matrix(runif(4), 2, 2),
matrix(runif(4), 2, 2),
matrix(runif(4), 2, 2))
appealing
- in an hour I picked up enough to do quite a bit, just by going through
examples in the author's book http://had.co.nz/ggplot2/. Will be
interesting to see how this package will be received by the community.
Stephen
--- Stephen Tucker [EMAIL PROTECTED] wrote:
Not that Trellis/lattice
I'm not able to make out your data but something like this?
df - data.frame(A=rnorm(10),B=rnorm(10),C=runif(10))
stripchart(df,method=jitter)
--- Tavpritesh Sethi [EMAIL PROTECTED] wrote:
Hi all,
I have 205 rows with measurements for three categories of people. I want to
generate stripplots
Hi David,
I'm not an expert in 'rgl', but to determine data-dependent color for points
I often use cut().
# using a very simple example,
x - 1:2; y - 1:2; z - matrix(1:4,ncol=2)
# the following image will be a projection of my intended 3-D 'rgl' plot
# into 2-D space (if we don't consider color
You do not have matching parentheses in this line
returnlow - gpdlow(var[,i][var[,i](p[,i][[2]])
most likely there is a syntax error that halts the execution of the
assignment statement?
--- livia [EMAIL PROTECTED] wrote:
Hi All, I am trying to make a loop for a function and I am using
Hi Lars,
I haven't tried this, but I believe there were a couple of messages on
the list recently on reading large files that basically used scan with
connections, and reading in by blocks.
see ?scan, ?connections
HTH
steve
Lars Modig wrote:
Hello
I’ve got a large CSV file (500M) with
),
lower=list(beta1=1,beta2=1,beta3=1))
Thanks in advance!
Stephen
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented
Actually, I believe attach() and detached() is discouraged nowadays...
x - read.delim(Filename.txt, header=TRUE)
You can access your data by column:
x[,1]
x[,c(1,3)]
or if your first column is named Col1 and the third Col3,
x[,Col1]
x[,c(Col1,Col3)]
and you can do the same to access by row -
I think you are looking for paste().
And you can replace your for loop with lapply(), which will apply regexpr to
every element of 'mylist' (as the first argument, which is 'pattern'). 'text'
can be a vector also:
mylist - c(MN,NY,FL)
lapply(paste(mylist,$,sep=),regexpr,text=Those from MN:)
You can just create another variable which contains the names you want:
## let
Year - c(rep(1999,2),rep(2000,2),rep(2001,3))
## one alternative
getYearCode1 - function(yr) {
# yr can be a vector
ifelse(yr==1999,Year1,
ifelse(yr==2000,Year2,
ifelse(yr==2001,Year3)))
Dear John,
Perhaps I am mistaken in what you are trying to accomplish but it seems like
what is required is that you call lstfun() outside of ukn(). [and remove the
call to lstfun() in ukn()].
nts - lstfun(myfile, aa, bb)
results - ukn(dd1, a, b, nts$cda)
Alternatively, you can eliminate the
This zooming function on the R-Wiki page was very neat:
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:interactive_zooming
Also, to answer question (a), maybe these examples might help?
## add elements to plot
plot(1:10,1:10)
lines(1:10,(1:10)/2)
points(1:10,(1:10)/1.5)
## add
You can list them together using | (which stands for 'or'):
c-subset(c,!rownames(c) %in% grep(.1|.5|.6|.9,rownames(c),value=T))
but . means any character for regular expressions, so if you meant a
decimal place, you probably want to escape them with a \\:
c-subset(c,!rownames(c) %in%
My mistake... last alternative should be:
c-subset(c,regexpr(\\.1|\\.5|\\.6|\\.9,rownames(c)) 0)
--- Stephen Tucker [EMAIL PROTECTED] wrote:
You can list them together using | (which stands for 'or'):
c-subset(c,!rownames(c) %in%
grep(.1|.5|.6|.9,rownames(c),value=T
If by 'position' you mean the distance from the axes, I think 'mgp' is the
argument you are looking for (see ?par)-
You can set this in par(), plot() [which will affect both x and y labels], or
title():
par(mar=rep(6,4))
plot(NA,NA,xlim=0:1,ylim=0:1,xlab=X,ylab=)
title(ylab=Y2,mgp=c(4,1,0))
if
Here are two ways:
## method 1
plot(1:100,y1)
par(new=TRUE)
plot(1:100,y2,xlab=,ylab=,col=2,axes=FALSE)
axis(4,col=2,col.axis=2)
## method 2
plot.new()
plot.window(xlim=c(1,100),ylim=range(y1))
points(1:100,y1)
axis(1)
axis(2)
title(xlab=x,ylab=y1)
plot.window(xlim=c(1,100),ylim=range(y2))
There are also some notes about this in the R Data Import/Export manual:
http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets
But I've gathered the following examples from the R-help mailing list
archives [in addition to the option of saving the spreadsheet as a .csv file
why 'whereis' does not identify this-- or why it
lists the file 3 times?.
I'm also puzzled why they chose to call the file exactly the same thing.
I will next try rpm --force as you suggest.
Stephen
-Original Message-
From: Peter Dalgaard [mailto:[EMAIL PROTECTED]
Sent: Fri 6/22/2007
this and not the 32bit file? Or do I need to edit
something in the rpm file?
Thanks
-Original Message-
From: Peter Dalgaard [mailto:[EMAIL PROTECTED]
Sent: Thu 6/21/2007 6:34 PM
To: Stephen Henderson
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] FW: Suse RPM installation problem
Stephen Henderson
reading the Installation manual I noted that libpng is mention
in the context of a source build. I therefore downloaded libpng-1.2.18
(v-1.2.8 or later is specified in the manual) and succesfully compiled
this. This did not however help with my problem.
Any suggestions?
Thanks
Stephen Henderson
with the labdsv library itself
- nothing you are doing wrong. The results will still be valid - but the use of
symbol.For is something that will eventually need to be changed in the labdsv
library.
hth,
stephen
__
R-help@stat.math.ethz.ch mailing list
https
Here is one way:
Vector1 - c(20080621.00,20080623.00)
Vector2 - c(20080620.00,20080622.00)
do.call(difftime,
c(apply(cbind(time1=Vector1,time2=Vector2),2,
function(x) strptime(x,format=%Y%m%d.00)),
units=hours))
see ?strptime, ?difftime and
Hi Paul,
Hope this is what you're looking for:
## reading in text (the first 13 rows of cc from your posting)
## and using smaller indices [(3,8) instead of (10,40)]
## for this example
cc - mode-(do.call(rbind,
+strsplit(readLines(textConnection(txt))[-1],[ ]{2,}))[,-1],
+
Hi Ana,
There are two ways in which I imagine this can be done:
(1) create a layout [using layout()] and printing the text on a blank plot;
(2) using Sweave.
## === Method 1 example... ===
pdf()
layout(matrix(c(1,1,2,3),ncol=2,byrow=TRUE),widths=c(1,1),heights=c(3,2))
par(mar=c(0,0,5,0))
for x in D.iteritems()]
## returns element key (name) along with element contents
[('sape', 4139), ('jack', 4098)]
And this is something of the effect I was looking for...
Thanks to all,
Stephen
__
R-help@stat.math.ethz.ch mailing list
https
Hi Horace,
I have also thought that it may be useful but I don't know of any Object
Explorer available for R.
However, (you may alread know this but)
(1) you can view your list of objects in R with objects(),
(2) view objects in a spreadsheet-like table (if they are matrices or data
frames)
a fear
response at the thought of a loop... (and as of recently, I have been
infatuated with the notion of adhering, albeit loosely, to the 'functional
programming' paradigm which makes me doubly fearful of loops)
Thanks and best regards,
Stephen
--- Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Tue
Maybe substring() is what you're looking for? Some examples:
substring(textstring,1,5)
[1] texts
substring(textstring,3)
[1] xtstring
substring(textstring,3,nchar(textstring))
[1] xtstring
--- Tim Holland [EMAIL PROTECTED] wrote:
Is there a way in R to select certain characters from a line
plot(x=1:10,y=1:10,xlim=c(0,5),ylim=c(6,10))
a lot of the arguments descriptions for plot() are contained in ?par
--- Patrick Wang [EMAIL PROTECTED] wrote:
Hi,
How to specify the start position of Y in plot command, hopefully I can
specify the range of X and Y axis. I checked the ?plot,
Since R is supposed to be a complete programming language, I wonder
why these tools couldn't be implemented in R (unless speed is the
issue). Of course, it's a naive desire to have a single language that
does everything, but it seems that R currently has most of the
functions necessary to do the
4
[2,] 2 4 5
[3,] 3 4 6
# then
mode(m) - numeric
# or
m - apply(m,2,type.convert)
# will give
m
[,1] [,2] [,3] [,4]
[1,]12 NA4
[2,]2 NA45
[3,]34 NA6
--- [EMAIL PROTECTED] wrote:
On 10-Jun-07 19:27:50, Stephen Tucker wrote
There's also this approach
plot(runif(10), ylab=list(Red, Bold?, col = red, font = 2),
xlab=Black, standard?)
On 5/31/07, Greg Snow [EMAIL PROTECTED] wrote:
Try this:
plot(runif(10), ylab=, xlab=Black, standard?)
mtext('Red, Bold', side=2, line=3, col='red', font=2)
Hope this helps,
You can also use type.convert() if you did want to convert your characters to
numbers and NA's to NA's so that you can use na.omit().
x - matrix(0,5,5)
x[1,3] - x[4,4] - NA
newx - apply(x,2,type.convert)
newx
[,1] [,2] [,3] [,4] [,5]
[1,]00 NA00
[2,]0000
$model$corStruct,
unconstrained = FALSE)
Stephen
--
Rochester, Minn. USA
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
of cases: 31
Selected 4 of 5 terms, and 2 of 2 predictors
Number of terms at each degree of interaction: 1 3 (additive model)
GCV: 11 RSS: 213 GRSq: 0.96 RSq: 0.97
Regards,
Stephen Milborrow
___
R-packages mailing list
[EMAIL PROTECTED]
https
Actually I am not sure what you want exactly, but is it
df1 -data.frame(b=c(1,2,3,4,5,5,6,7,8,9,10))
df2 -data.frame(x=c(1,2,3,4,5), y=c(2,5,4,6,5), z=c(10, 8, 7, 9, 3))
df1 - cbind(df1,
colnames-(sapply(with(df2,(x+y)/z),
function(a,b) a/b,b=df1$b),
Sometimes I just overlay a blank plot and annotate with text.
par(mfrow=c(1,2), oma=c(2,0,2,0))
plot(1:10)
plot(1:10)
oldpar - par()
par(mfrow=c(1,1),new=TRUE,mar=rep(0,4),oma=rep(0,4))
plot.window(xlim=c(0,1),ylim=c(0,1),mar=rep(0,4))
text(0.5,c(0.98,0.02),c(Centered Overall Title,Centered
am trying to minimize
intermediate variable assignment (perhaps a futile effort). But if anyone
knows of an easy solution, I'd appreciate a tip.
Thanks very much!
Stephen
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r
Good luck,
Stephen
--
Rochester, Minn. USA
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained
Thanks guys for the suggestions guys- I come across this problem a lot but
now I have many solutions.
Thank you,
Stephen
--- Peter Dalgaard [EMAIL PROTECTED] wrote:
Peter Dalgaard wrote:
Stephen Tucker wrote:
Dear R-helpers,
Does anyone know how to use regular expressions
hist(rnorm(100),xlab=Data,ylab=Count,main=)
title(main=Histogram of ...,cex=0.5)
see ?par for details on xlab, ylab, main, and cex arguments.
You can call these from title() or include them in hist().
I called title(main=..) separately to control its size separately
from the rest of the text
My apologies. Second line should be
title(main=Histogram of ...,cex.main=0.5)
Actually I just realized you can also do
hist(rnorm(100),xlab=Data,ylab=Count,cex.main=0.5)
...this way you don't have to call title() separately.
--- Stephen Tucker [EMAIL PROTECTED] wrote:
hist(rnorm(100),xlab
Edward Tufte seems to have some opinions on this topic.
In The Visual Display of Quantitative Information (Chapter 6: Data-Ink
Maximization and Graphical Design - Redesign of the Scatterplot), he
presents several alternatives
(1) non-data-bearing frame in conventional scatterplots (equivalent to
## making data up
# make matrix with some equal values
mat - cbind(x=rnorm(10),y=rnorm(10),z=rnorm(10))
mat[c(8,9),y] - mat[c(1,7),x]
mat
x y z
[1,] 0.26116849 0.5823529 -0.96924020
[2,] -0.21415406 0.1085396 2.00542549
[3,] 0.56890081 -1.2526322
you have to use POSIXct classes to include date-time objects into data
frames. strptime() returns an object of class of POSIXlt. when you do the
cbind(), it automatically converts test2 into POSIXct
you probably want
bsamp$spltime-as.POSIXct(strptime(test,format=%d-%B-%y %H:%M))
(but please be
You can also set this option globally with options(stringsAsFactors = TRUE)
I believe this was added in R 2.4.0.
--- Gabor Grothendieck [EMAIL PROTECTED] wrote:
Try this:
DF - data.frame(let = letters[1:3], num = 1:3, stringsAsFactors = FALSE)
str(DF)
On 4/19/07, John Kane [EMAIL
I use gdata and it works quite well for me. It's as easy as
install.packages(gdata)
library(gdata)
data = read.xls(mydata.xls,sheet=1)
[read.xls() can take other arguments]
It requires concurrent installation of Perl, but installing Perl is also
simple. For Windows, you can get it here:
...is this what you're looking for?
donedat - subset(data,ID 6000 | ID = 7000)
findat - donedat[-unique(rapply(donedat,function(x)
which( x 0 ))),,drop=FALSE]
the second line looks through each column, and finds the indices of negative
values - rapply() returns
1 - 100 of 274 matches
Mail list logo