similar to: save a list as a matrix

Displaying 20 results from an estimated 30000 matches similar to: "save a list as a matrix"

2013 Mar 15
3
reviewer comment
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20130315/7300f19c/attachment.pl>
2009 Sep 09
2
How to sum and group data by DATE in data frame
Dear all, Lets say I have a data frame as follows: > Date <- as.Date(c('2006-08-23', '2006-08-30', '2006-09-06', '2006-09-13', '2006-09-20')) > Income <- c(73.79, 72.46, 76.32, 72.43, 72.62) > data.frame(Date, Income) Date Income 1 2006-08-23 73.79 2 2006-08-30 72.46 3 2006-09-06 76.32 4 2006-09-13 72.43 5 2006-09-20 72.62 >
2010 Jan 25
3
binary
Hi all Assume I have a data set xx; Group: 1=group1 ?, 2=group2 IQ: ?1= High, 0 =low fit <- glm(IQ ~group, data = xx, family = binomial()) summary(fit) Results ?????? ????????????Estimate Std. Error z value Pr(>|z|) (Intercept) -2.55456??? 0.210 -12.273? < 5e-16 *** group????????? 0.36180 ?????0.076?? 3.952 ????5.24e-05 *** the odd ratio = exp(0.36180 )= 1.435912 My question
2010 May 05
2
t.test per line
Dear All, I apologize for this trivial question, I can not find the solution I try to use t.test function per line in the data.frame, But i dont'understand the error message my program is as follows group1<-gl(2,20) fun<-function(x){ m<-data.frame(group1,x) #anova(aov(x ~ group1, m)) t.est(x ~ group1,m) } ttest<- apply(data, 1, fun) Error in t.test.default(x = c(1, 1,
2011 May 25
2
Fwd: transpose ?
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20110525/4926c5ee/attachment.pl>
2011 May 25
1
transpose ?
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20110525/acc78a27/attachment.pl>
2010 May 25
4
R eat my data
HI, Dear R community, My original file has 1932 lines, but when I read into R, it changed to 1068 lines, how comes? cdu@nuuk:~/operon$ wc -l id_name_gh5.txt 1932 id_name_gh5.txt > gene_name<-read.table("/home/cdu/operon/id_name_gh5.txt", sep="\t", skip=0, header=F, fill=T) > dim(gene_name) [1] 1068 3 -- Sincerely, Changbin -- Changbin Du DOE Joint Genome
2009 Sep 07
2
Averaging rows if a condition is true.
Dear All, I have matrix (50000 X 60) of subjects and their responses to a set of questions. All responses are classified into categories (500). I would like to average all subject's responses for each category. I wrote a code using a for loop but is not working. Could please tell me what's wrong with the code? I guess, there is a elegant R way of doing the same thing. Thanks in advance.
2010 Feb 17
2
Is the aggregate function the best way to do this?
Hi, I''m having a dataframe ''Subset1'' with a number of factor variables and 160 numerical variables Now I want to make sums for all rows that have the same values for the different factor variables, except for the factor variables: VAR1,VAR2,VAR3 who may have the same values. With the formula given below this works great, but in a situation with 15000 rows and 13
2010 Apr 30
3
Find solution for an error in the condition of if
Dear r-help, Could you help me to find a solution for this error: Il y a eu 50 avis ou plus (utilisez warnings() pour voir les 50 premiers) > warnings() Messages d'avis : 1: In if ((data[pa, k] == df[, j]) & (data[ch, k] == i)) { ... : la condition a une longueur > 1 et seul le premier élément est utilisé 2: In if ((data[pa, k] == df[, j]) & (data[ch, k] == i)) { ... : la
2011 Dec 15
1
Multicollinearty in logistic regression models
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20111215/d9983681/attachment.pl>
2009 Nov 11
2
Error in lm() function
Hi all, I wanted to have a seasonality study like whether a particular month has significant effect as compared to others. Here is my data : 0.10499 0 0 1 0 0 0 0 0 0 0 0 0.00259 0 0 0 1 0 0 0 0 0 0 0 -0.06015 0 0 0 0 1 0 0 0 0 0 0 0.10721 0 0 0 0 0 1 0 0 0 0 0 0.03597 0 0 0 0 0 0 1 0 0 0 0 0.10584 0 0 0 0 0 0 0 1 0 0 0 0.02063 0 0 0 0 0 0 0 0 1 0 0 -0.03509 0 0 0 0 0 0 0 0 0 1 0 -0.03485 0 0 0
2009 Aug 26
4
Select top three values from data frame
Hi, I'm trying to find an easy way to do this. I want to select the top three values of a specific column in a subset of rows in a data.frame. I'll demonstrate. A B C x 2 1 x 4 1 x 3 2 y 1 5 y 2 6 y 3 8 I want the top 3 values of B from the data.frame where A=X and C <2 I could extract all the rows where C<2, then sort by B, then take
2010 Apr 14
6
sum specific rows in a data frame
I have a data frame called "pose": DESCRIPTION QUANITY CLOSING.PRICE 1 WHEAT May/10 1 467.75 2 WHEAT May/10 2 467.75 3 WHEAT May/10 1 467.75 4 WHEAT May/10 1 467.75 5 COTTON NO.2 May/10 1 78.13 6 COTTON NO.2 May/10 3 78.13 7 COTTON NO.2 May/10 1 78.13
2013 Sep 25
1
Computing calculation among two vectors
Hi, Try: x<- 1:4 ?y<- c("*","/","-","+") res<-sapply(y,function(i) {x1<-expand.grid(x,x); unlist(lapply(paste0(x1[,1],i,x1[,2]),function(u) eval(parse(text=u))))}) row.names(res)<- as.character(interaction(expand.grid(x,x),sep="_")) head(res) #??? *?? /? - + #1_1 1 1.0? 0 2 #2_1 2 2.0? 1 3 #3_1 3 3.0? 2 4 #4_1 4 4.0? 3 5 #1_2 2 0.5
2010 Feb 16
2
Error of Stepwise Regression with number of rows in use has changed: remove missing values?
Howdy, R Grues I have enjoyed R, but I cannot solve one problem easily. Please help my problem. When I tried the R script, I got the following Error. This error results from input data file exported through a Excel spreadsheet software. Error in step(lm(pop.rate ~ as.numeric(year) + as.factor(policy) + as.numeric(nation.grant) + ?: ??number of rows in use has changed: remove missing values?
2013 Sep 02
3
Product of certain rows in a matrix
Hi, You could try: A<- matrix(unlist(read.table(text=" 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 ",sep="",header=FALSE)),ncol=3,byrow=FALSE,dimnames=NULL) library(matrixStats) ?res1<-t(sapply(split(as.data.frame(A),as.numeric(gl(nrow(A),2,6))),colProds)) ?res1 #? [,1] [,2] [,3] #1??? 4?? 10?? 18 #2?? 63?? 64?? 63 #3?? 18?? 10??? 4
2015 Feb 24
2
iterated lapply
> On Feb 24, 2015, at 10:50 AM, <luke-tierney at uiowa.edu> wrote: > > The documentation is not specific enough on the indented semantics in > this situation to consider this a bug. The original R-level > implementation of lapply was > > lapply <- function(X, FUN, ...) { > FUN <- match.fun(FUN) > if (!is.list(X)) > X <-
2013 Jul 02
2
cache most-recent dispatch
Hi, S4 method dispatch can be very slow. Would it be reasonable to cache the most recent dispatch, anticipating the next invocation will be on the same type? This would be very helpful in loops. fun0 <- function(x) sapply(x, paste, collapse="+") fun1 <- function(x) { paste <- selectMethod(paste, class(x[[1]])) sapply(x, paste,
2015 Feb 26
1
iterated lapply
> On Feb 25, 2015, at 5:35 PM, Benjamin Tyner <btyner at gmail.com> wrote: > > Actually, it depends on the number of cores: Under current semantics, yes. Each 'stream' of function calls is lazily capturing the last value of `i` on that core. Under Luke's proposed semantics (IIUC), the result would be the same (2,4,6,8) for both parallel and serial execution. This is