yeah, just use points
twogrp<-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22)
gpcol<-c(2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)
gap.plot(twogrp,gap=c(8,12),xlab="Index",ylab="Group values",
main="Plot gap on Y axis",col=gpcol)
twogrp2<-c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22)
points(
maybe this is easiest way to do it:
x<-c("A","B",NA,NA,"C",NA,NA,NA,NA,"D",NA,NA);
x[is.na(x)]<- "D"; x
thanks
y
Owen Jones-3 wrote:
>
> I have a vector of data (species names) interspersed with NA values
> and I want a function to "fill in the blanks", replacing NA values
> with wha
Hi,
How can I generate a random signal that's correlated with a given signal at
a given correlation (say 0.7)?
I've been looking at rmvnorm etc but don't seem to figure it out. Thanks
-
Yasir H. Kaheil
Columbia University
--
View this message in context:
http://www.nabble.com/generating-a-
th(x))
yp<-pnorm(y)
ypix<- sort(yp[,1],index.return=TRUE)$ix
yp<-yp[ypix,];
yps<-yp[,1];# dummy initialization
yps[xix]<-yp[,2];
#adjust mean and sd here.
yqs<-qnorm(yps,mean=mean(x),sd=sd(x));
cor(x,yqs)
Yasir Kaheil wrote:
>
> Hi,
> How can I generate a random signal
yes just use %in% instead of == AllMax.. but also use table for count
-
Yasir Kaheil
--
View this message in context:
http://r.789695.n4.nabble.com/Subset-based-on-multiple-values-tp4636159p4636183.html
Sent from the R help mailing list archive at Nabble.com
just do this:
colnames(r)<-substr(colnames(r),2,nchar(colnames(r)))
This will remove the X.
Later when you want to use the headed to plot something, cast it as numeric:
plot(colMeans(r)~as.numeric(colnames(r)))
-----
Yasir Kaheil
--
View this message in context:
http://r.789695.n4.nabble.
type ?read.table in R
-
Yasir Kaheil
--
View this message in context:
http://r.789695.n4.nabble.com/Entering-Data-Files-tp4636943p4636959.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https
in biplot you could set the limits xlim, ylim of the axes to zoom in on the
plot.
-
Yasir Kaheil
--
View this message in context:
http://r.789695.n4.nabble.com/PCA-tp4636840p4636961.html
Sent from the R help mailing list archive at Nabble.com
type ?merge in R
-
Yasir Kaheil
--
View this message in context:
http://r.789695.n4.nabble.com/Merging-Data-Frames-in-R-tp4636781p4636962.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https
use function system in R
for (x in 1:100){
system (paste("rename file0.",x,"_data.RData file",x,"_data.Rdata",sep=""))
}
-
Yasir Kaheil
--
View this message in context:
http://r.789695.n4.nabble.com/change-file-name-from-file0-1-data-RData-to-file
Please refer to: qtriangle function in VGAM library
thanks
y
Alberto Monteiro wrote:
>
> The Runuran package includes a simulation for the Triangular Distribution,
> urtriang. But I didn't find an analogue of the q* functions (rnorm -
> qnorm,
> runif - qunif), that would invert the CDF (?uqt
the variance is the eigen values of the correlation matrix of yoru matrix
X.cor <- cor(X)
X.e <- eigen(X.cor)
X.e$values# Eigenvalues of cor(X) = variances you're asking about
kayj wrote:
>
> Hi All,
>
> I performed an svd on a matrix X and saved the first three column of the
> left singular
hi Nate,
could you please email me your excel workbook. thanks
y
nmarti wrote:
>
> I'm trying to write R functions into VBA code. I've done this many other
> times in other documents and everything has run great. But today I keep
> recieving an error message "Run-time error '1004': Application
glad to hear things worked out.
y
nmarti wrote:
>
> Ok, so I'm embarrassed to admit I made a really dumb mistake. My VBA page
> was declared as "Sheet1" code when it should have been "Module1" code.
> I knew it was something stupid. Sorry for the inconve
Is it possible to have one array for bias and one for variance? such as..
biasAr=
b1 b2
a1 biasbias
a2 biasbias
and
varAr=
b1 b2
a1 var var
a2 var var
then you can combine the two in a data frame?
thanks
y
Michael Prince wrote:
>
> Dear R users,
>
> I
hi there:
please refer to:
http://www.math.usu.edu/~adele/forests/cc_home.htm
and
http://www.math.usu.edu/~minnotte/S5600S07/R17.txt
thanks
BertrandM wrote:
>
> Hello
>
> Is there exists a package for multivariate random forest, namely for
> multivariate response data ? It seems to be imposs
yes use plotting chars 22, 21
replace your legend statement with:
legend(x="topright", legend=c("2006 mean", "2007 mean", "2008 mean",
"1964-2005 mean \n max and min flows "), pch=c(22, 22, 22, 21),
col=c(1,1,1,1), pt.bg=c(grey.colors(3, gamma=4),"black"), cex=1.5)
box(which="plot", lty="solid
the function is there in grDevices
http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/png.html
type ? png
if tiff() is not listed, you need to update R to get the new base with new
grDevices.
thanks
y
Daniel Steinberg wrote:
>
> Greetings R users!
>
> I am working with the ENSEM
yes R has everything that TRICAST offers.. and much more
Kenneth Cabrera-2 wrote:
>
> Hi R users:
>
> I will like to know if somebody works on insurance statistics
> (actuarial problems) and had use TRICAST, and can tell me
> if with all the R tools it can be build a solution
> like TRICAST or
You could just say:
yhat=predict(reg1,x2)
the function predict will assing x2 to 'newdata' by default.
thanks
Daniel Malter wrote:
>
> Hi,
>
> could it be the "newdata" argument? When I run predict with the newdata
> argument, I get an error message - a different one though. The second
> rea
I came across this little problem in the xYplot function recently and I found
it very poorly documented. The legend (keys) in the xYplot is very
confusing, especially if you want to change the data labels you have in the
data frame column names... say for example you want something with a
subscrip
you could do it using apply like the first two replies mentioned or you could
just use the index way
for example: (assuming your matrix name is ym and the values are greater
than 25 and less than 50 and the column is column 3).. if you mean "any
column" use the first two replies.
> ym<-array(runi
try:
write.table(x, file="/Users/Desktop/Data.txt", row.names= FALSE, col.names=
FALSE, sep="", append=TRUE)
this should do it. If you don't want to append, just turn that opion off.
Stropharia wrote:
>
> Dear R users,
>
> I've had no joy finding a solution to this online or in any of my R
#Install library rgl
#here is the is the function:
rgl.plot3d<-function(z, x, y, cols="red",axes=T,new=T)
{xr<-range(x)
x01<-(x-xr[1])/(xr[2]-xr[1])
yr<-range(y)
y01<-(y-yr[1])/(yr[2]-yr[1])
zr<-range(z)
z01<-(z-zr[1])/(zr[2]-zr[1])
if(new) rgl.clear()
if(axes)
{xlab<-pretty(x)
yl
user parameter "offset"
barplot(d,offset = -2) #assuming that d is your data
Summer Nitely wrote:
>
> Hi,
> I have data that is on a log base 2 scale. It goes from negative factors
> of
> 2 to positive ones. I am using barplot. However, I don't want the data
> centered at 0 - I want the min
Hi Cedric,
to change the names of different boxes, you could use levels on the
dataframe factor variable you're plotting- see this example:
library('lattice');
bwplot(voice.part ~ height, data=singer, xlab="Height (inches)")
singer.m<-singer
levels(singer.m$voice.part)<- c("a","f","g","j","k","o",
Hi
This is an ad-hoc fix..
d<-rnorm(4)
plot(1:4,d)
g<-3;
rug((1:4),ticksize=-.03,lwd=g,side=1)
rug((1:4),ticksize=0,lwd=(g-1),side=1,col="white")
just drawing another white axis on top of the old one.. it looks ok :)
y
maiya wrote:
>
> Hi!
>
> (a complete newby, but will not give up easil
Hi Ottorino,
You could just use the modulus operator "%%" as follows:
> x<-c(1803.02, 193.51, 3.47);
> x-x%%c(50,5,1) #just using the modulus operator
[1] 1800 1903
thanks
Dr. Ottorino-Luca Pantani wrote:
>
> Dear R-users,
> I have the following problem
>
> In a lab experiment I have to
cast the two vectors as.matrix-- see here:
plot(as.matrix(f[2,4:26]), as.matrix(f[1,4:26]))
y
stephen sefick wrote:
>
> f <- (structure(list(X = structure(96:97, .Label = c("119DAmm", "119DN",
> "119DNN", "119DO", "119DOC", "119Flow", "119Nit", "119ON", "119OPhos",
> "119OrgP", "119Phos", "11
#Install library rgl
#here is the function which you need to run first:
rgl.plot3d<-function(z, x, y, cols="red",axes=T,new=T)
{xr<-range(x)
x01<-(x-xr[1])/(xr[2]-xr[1])
yr<-range(y)
y01<-(y-yr[1])/(yr[2]-yr[1])
zr<-range(z)
z01<-(z-zr[1])/(zr[2]-zr[1])
if(new) rgl.clear()
if(axes)
ze data as we speak and R along with all of your help is an
> invaluable tool. Am I missing something easy, do I not understand the
> logic/philosophy, or...?
> thanks
>
> Stephen
>
> On Tue, May 6, 2008 at 12:53 PM, Yasir Kaheil <[EMAIL PROTECTED]> wrote:
>
>>
vector dat1.select is the selected records from dat1 by dat2.
> dat1.select<- dat1$x1 %in% dat2$x2 & dat1$y1 %in% dat2$y2
> dat1[dat1.select,]
x1 y1 descript
1 1824615 5980732 cat
2 1823650 5983220 dog
Andrew McFadden wrote:
>
> Hi R users
>
> I am trying to create a sp
assuming what you have is a dataframe called x
try:
table(Plant=x$plant,Location=x$location)
Location
Plant x y z
a 1 1 2
b 2 2 0
or simply:
table(x$plant,x$location)
x y z
a 1 1 2
b 2 2 0
thanks
juanita choo wrote:
>
> Hi
> I would like to know how to pivot a table t
from the upper menu, go to edit/gui preferences
then you can increase the font size. i used windows so im not sure if this
works on mac.
thanks
juanita choo wrote:
>
> Hi,
>
> I am having a situation where I cannot change the output size of the R
> console. I have played around with the font
is it possible that regsubsets divides the subset dataset into training and
testing set.. so when it calculates R^2 it's not the same as what you'd get
with lm. You probably need to look into the source code to know if this is
true or not
Edwards, David J wrote:
>
> Hi,
>
> I'm new to R and
interesting request..I'm looking forward to the replies
All I could come up with is putting it in two lines..
pr<-array(0,c(dim(x)[2],dim(x)[2]));
for (i in 1:dim(x)[2]) for (j in 1:dim(x)[2])
pr[i,j]<-cor.test(x[,i],x[,j])$p.val;
y
Monica Pisica wrote:
>
>
> Hi everybody,
>
> I would lik
you need to redefine the factor on ex1$id.. cast it again as.factor to
redefine the levels.
Dipankar Basu wrote:
>
> Hi!
>
> I am using R version 2.7.0 and am working on a panel dataset read into R
> as
> a dataframe; I call it "ex". The variables in "ex" are: id year x
>
> id: a character
Hi Worik:
Is this what you want?
> Names <- letters[1:5];
> Dates<- 1:20;
> d<- data.frame(dates=Dates, a = vector(mode="numeric",
> length=length(Dates)));
> for(i in 2:5){d[,paste(sep="",Names[i])]<-with(d,a)}; d
dates a b c d e
1 1 0 0 0 0 0
2 2 0 0 0 0 0
3 3 0 0 0 0 0
4
try:
obs_data<- c(26,43,20,14,18);
pre_gam<-c(26.284,61.101,29.016,11.160,11.439)
(obs.hist <- hist(obs_data, breaks = 10, plot = FALSE));
plot(obs.hist)
plot(obs.hist, border = "dark blue", col = "light blue", xlab ="whatever")
(pre.hist <- hist(pre_gam, breaks = 10, plot = FALSE));
lines(pre.his
> dat<-array(runif(30),c(15,2));
> dat<-data.frame(x=dat[,1],y=dat[,2]);
> linm<-lm(y~x,data=dat);
> linm.s<-summary(linm);
> attributes(linm.s) #to see all attributes of the summary
$names
[1] "call" "terms" "residuals" "coefficients"
[5] "aliased" "sigma" "d
use the parameter 'skip' in read.table
dat<-read.table("filename",skip=number of rows you want to skip)
thanks
y
DAVID ARTETA GARCIA wrote:
>
> Dear list,
>
> I have a text file from a scanner that includes 20 lines of text
> (scanner settings) before it actually starts showing the readin
it's a good question.. my guess is using "panel.bpplot" prevents filling in
the shape "the coffins"- since the box is now two mirrored graphs. i hope
i'm wrong.
trellis.par.get()
br = trellis.par.get("box.rectangle")
br$col = "black"
br$fill = "lightblue" #this is the parameter that fills in
> DF1<- data.frame(Name=as.factor(c("A","B","C")), Age= c(21,45,30))
> DF2<- data.frame(Name=as.factor(c("A","B","X")), Age= c(50,20,10))
> DF3<- data.frame(Name=as.factor(c("B","Y","K")), Age= c(40,21,30))
>
> merge(merge(DF1,DF2, by.x= "Name", by.y="Name",
> all=TRUE),DF3,by.x="Name",by.y="Name
try
alltrees <- predict(fit, model.dat2) # make sure response variable is not
included in model.dat2
also to see the other attributes in "fit", try: attributes(fit)
thanks
y
coldeyes.Rhelp wrote:
>
> Hi All:
>
> how to get the coefficient for logic regression using selection=2 ( fit
> mult
nnealing)
>
> new<-data.frame(Z)
> new<-NULL
> alltrees <- predict(logicfit, new)
>
> names(logicfit)
>
> doesn't have coef class.
>
> thanks
>
>
>
>
> Yasir Kaheil wrote:
>>
>> try
>> alltrees <- predict(fit, mod
hi all,
how can I create sequences that start from a known vector, say x1 and end
with another say x2- also suppose all the sequences will be the same length.
I don't want to use a for loop
x1<-c(1,2,3,4); x2<-(3,4,5,6);
what I want is
1 2 3 4
2 3 4 5
3 4 5 6
Thanks
-
Yasir H. Kaheil
Colum
Great! thank you so much!
Dimitris Rizopoulos-4 wrote:
>
> one way is using mapply(), e.g.,
>
> mapply(":", 1:4, 3:6)
>
>
> I hope it helps.
>
> Best,
> Dimitris
>
>
> Yasir Kaheil wrote:
>> hi all,
>> how can I create seq
Hi list,
Does anyone know if there is a library in R that does MTM-SVD method for
spectral analysis?
Thanks
-
Yasir H. Kaheil
Columbia University
--
View this message in context:
http://www.nabble.com/Spectral-analysis-with-mtm-svd-Multi-Taper-Method-Combined-with-Singular-Value-Decomposit
48 matches
Mail list logo