Displaying 9 results from an estimated 9 matches for "colx".
Did you mean:
col
2012 May 23
3
applying cbind (or any function) across all components in a list
#If I have two lists as follows
a1<- array(1:6, dim=c(2,3))
a2<- array(7:12, dim=c(2,3))
l1<- list(a1,a2)
a3<- array(1:4, dim=c(2,2))
a4<- array(5:8, dim=c(2,2))
l2<- list(a3,a4)
#how can I create a new list with the mean across all arrays within the
list, so all components are included? As an example for [[1]];
cbind((l1[[1]][,1]+l2[[1]][,1])/2,
2007 Feb 19
1
memory management uestion
...ll,
I would like to ask the following.
I have an array of data in an objetct, let's say X.
I need to use a for loop on the elements of one or more columns of X and I am
having a debate with a colleague about the best memory management.
I believe that if I do:
col1 = X[,1]
col2 = X[,2]
...
colx = X[,x]
and then
for(i in whatever){
do something using col1[i], col2[i] ... colx[i]
}
my memory management is better that doing:
for(i in whatever){
do something using X[i,1], X[i,2] ... X[,x]
}
BTW, here I *have to* use a for() loop an no nifty tapply, lapply and family.
Any comment is wel...
1998 Jan 13
0
funny axis ranges; GPretty(.) vs. pretty(.) and all that...
...----------------------------------------------------
## Author: Martin Maechler, Date: 12 Jan 98, 18:15
lk <- length(k.set); slk <- ceiling(sqrt(lk))
op <- par(mfrow=c(slk,slk), mar = .2+c(3,2,1,1), oma=rep(1,4))
on.exit(par(op))
## oma does not really work
if(is.R()) { colx <- rainbow(lk); coly <- terrain.colors(lk)
} else colx <- lk + (coly <- 1:lk)
for(i in 1:lk) {
k <- k.set[i]
if(is.R()) {
plot.new()
plot.window(xlim= c(0,10^ k),
ylim= c(0,10^(k+y.k.add)),"")
box(lty='dashed...
2008 Sep 22
1
gbm error
Good afternoon
Has anyone tried using Dr. Elith's BRT script? I cannot seem to run
gbm.step from the installed gbm package. Is it something external to gbm?
When I run the script itself
<- gbm.step(data=model.data,
gbm.x = colx:coly,
gbm.y = colz,
family = "bernoulli",
tree.complexity = 5,
learning.rate = 0.01,
bag.fraction = 0.5)
... I keep encountering the same error:
ERROR:
unexpected ')' in "bag.fraction = 0.5)"
I've tried all sorts of variations (suc...
2011 Nov 21
6
Scatter plot - using colour to group points?
Dear All,
I am very new to R - trying to teach myself it for some MSc coursework.
I am plotting temperature data for two different sites over the same time
period which I have downloaded from a university weather station data
archive.
I am using the following code to create the plot
plot ( x = TEMP3[,"TIME"], y = TEMP3[,"TEMP"], type = "p", col =
2015 Feb 24
2
intercalar elementos de vectores
...t; vtmp <- as.data.frame(lapply(letters,function(x) { rep(x,each=50) }))
> > names(vtmp) <- paste("col",LETTERS,sep="")
> > head(vtmp)
> colA colB colC colD colE colF colG colH colI colJ colK colL colM colN
> colO colP colQ colR colS colT colU colV colW colX colY colZ
> 1 a b c d e f g h i j k l m n
> o p q r s t u v w x y z
> 2 a b c d e f g h i j k l m n
> o p q r s t u v w x y z
> 3 a...
2015 Feb 24
2
intercalar elementos de vectores
Excelente! Ahora corre muy rápido. No conocía ese método, creo que me va a
resultar muy útil.
Muchas gracias y saludos.
Fernando Macedo
El 24/02/15 a las 10:51, Jorge I Velez escribió:
Fernando,
Podrias intentar
R> a <- rep('a', 5)
R> b <- rep('b', 5)
R> a
[1] "a" "a" "a" "a" "a"
R> b
[1] "b"
2012 Oct 12
3
Columns and rows
Hi,
Could you please advice some easy way to do the following for a dataframe
(header=F) having unequal column- & row- length.
1. Combine/stack/join contents from -
a) multiple rows into one column.
b) multiple columns into one row.
2. Stack contents from multiple columns (or, rows) into one column (or,
row).
Thank you.
Cheers,
Santana
[[alternative HTML
2006 Nov 30
4
Quicker way of combining vectors into a data.frame
Hi,
In a function, I compute 10 (un-named) vectors of reasonable length
(4471 in the particular example I have to hand) that I want to combine
into a data frame object, that the function will return.
This is very slow, so *I'm* doing something wrong if I want it to be
quick and efficient, though I'm not sure what the best way to do this
would be.
I know it is the combining into data