Displaying 5 results from an estimated 5 matches for "datavec".
Did you mean:
datasec
2011 Jun 30
1
Match strings across two differently sized dataframes and copy corresponding row to dataframe
...he code for the string into the larger dataframe. Here's my
idea so far:
# comments is the smaller dataframe with the codes, mydata is the
larger dataframe to which I would like to copy it.
commvec=charmatch(comments$ImproveOne, mydata$Improve) # this is the
match between the strings one way
datavec=charmatch(mydata$Improve, comments$ImproveOne) # this is the
match the other way
mydata$ImproveCat1=NA # produce a variable to hold the copied codes
mydata$ImproveCat1[datavec[!is.na(datavec)]]=
comments$ImproveCat[commvec[!is.na(commvec)]] # for all the non
missing row numbers identified in the...
2010 Dec 06
1
R cmd batch with parameters
...nto the
output file.
I cannot deal somehow with passing the parameters to the function it
works from R with the parameters set fixed.
I'd really very much appreciate comment where I go wrong and possible
solutions. I paste the code below:
spinR <- function(){
args<-(commandArgs())
dataVec <- read.table(args[1], sep=" ")
attach(dataVec)
a<-dim(dataVec)
indMax<- 1:a[2]
for(i in 1:a[2]){
indMax[i]<-which.max(dataVec[,i])
}
write.table(indMax, file=args[2], col.names=FALSE, row.names=FALSE)
}
How would I pass the arguments via command line?...
2007 Dec 06
0
alternatives to latex() or xtable()
...er.vars = sapply(list(rep("r|", (length(colnames(df))-length(
by.vars)) )),paste,collapse="")
align.df = paste("|", align.by.vars , "|" , align.other.vars ,sep="")
xt=xtable(df, align = align.df,...)
return(xt)
}
bytable = function(datavec,indices,ops=c(quote(mean)),ops.desc=list
(mean="Mean"),na.rm=TRUE,...) {
groups=as.character()
combinations.others=c()
# indices should be a list of grouping vectors, just like you would pass
to -by-, but with sensible names for each vector
if(!is.list(indices)) {...
2009 Aug 04
1
Build a dataframe row by row?
Hi,
Time for another of my "newbie" questions.
Is it possible to build up a data.frame "row by row" as I go
I'm going to be running a bunch of experiments (many in a loop) to test
different things. I'm using AUC as my main performance measure.
My thought was to add a row to a data.frame for each iteration and then
have a nice summary report at the end.
I found
1999 Jan 18
0
Selecting a subgroup
...if (nargs() > 3) {
min.cond <- groupvec >= min
max.cond <- groupvec < max
cond <- min.cond & max.cond
selected <- na.remove(ifelse(cond, data, NA))
invisible(selected)
}
else cat("Usage: select.range(groupvec,min,max,datavec)\n")
}
e.g.
> tdata.df<-read.table("tdata",header=T,sep=",")
> tdata.df
group value year
1 1 0 1980
2 1 10 1981
3 1 14 1982
4 1 20 1983
5 1 25 1984
6 1 30 1985
7 2 0 1980
8 2 5 1981
9 2...