similar to: standardize columns selectively within a dataframe

Displaying 20 results from an estimated 8000 matches similar to: "standardize columns selectively within a dataframe"

2010 Aug 05
3
PageUp/Down in gnome-terminal
Dear all, I am using gnome-terminal to run R, and I noticed that standard PageUp/Down do not work but they do work for other programs within the same terminal window (e.g. irssi). Scroll bar does not work either. I run R using GNU-screen, but it doesn't seem to make any difference. Many thanks Olga ------------------ R version 2.11.1 (2010-05-31) 2010 x86_64 GNU/Linux Ubuntu 10.04.1 LTS
2010 Mar 14
6
barplot with a probability density curve
Dear all, I am making a barplot as following: barplot(c(1,2,3,5,2,3,1),names.arg=c("100","200","300","400","500","600","700"),xlab="diameter",ylab="flow",main="some title",space=0.1) I am also trying to add a probability density curve, however using lines(density(c(1,2,3,5,2,3,1))) does not give
2010 Sep 02
2
lower triangle of the correlation matrix with xtable
Dear all, mydata<-data.frame(x1=c(1,4,6),x2=c(3,1,2),x3=c(2,1,3)) cor(mydata) x1 x2 x3 x1 1.0000000 -0.5960396 0.3973597 x2 -0.5960396 1.0000000 0.5000000 x3 0.3973597 0.5000000 1.0000000 I wonder if it is possible to fill only lower triangle of this correlation matrix? Using 'dist' doesn't seem to be useful as it doesnt allow to convert this table
2009 Aug 04
3
read.csv from a remote machine
Dear all, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. I would appreciate any suggestions, Thanks! Olga
2010 Aug 03
2
multiple R sessions from one working directory using GNU screen
Dear all, I am using GNU screen to run multiple R sessions from one working directory in order to split task, however I noticed that dataset is not synchronized e.g. if I have two sessions R1 and R2, and I remove an object from R1, R2 doesn't change as expected or change at random. I have tried to save.image(), q() and then restart both sessions, but it does not help. Any suggestions?
2011 Feb 04
2
vegan and sweave using xtable
Dear all, Using: library(vegan) data(BCI) mod <- radfit(BCI[1,]) mod RAD models, family poisson No. of species 93, total abundance 448 par1 par2 par3 Deviance AIC BIC Null 39.5261 315.4362 315.4362 Preemption 0.042797 21.8939 299.8041 302.3367 Lognormal 1.0687 1.0186 25.1528 305.0629 310.1281
2010 Aug 11
2
Sweeping a zoo series
Given a long zoo matrix, the goal is to "sweep" out a statistic from the entire length of the sequences. longzoomatrix<-zoo(matrix(rnorm(720),ncol=6),as.yearmon(outer(1900,seq(0,length=120)/12,"+"))) cnames<-c(12345,23456,34567,45678,56789,67890) colnames(longzoomatrix)<-cnames longzoomatrix[1:24,] 12345 23456 34567 45678
2010 Mar 05
1
looking into function body without package installation
Dear all, I was wondering if there is a way to explore a syntax of particular function without package installation? I am trying to write my own functions, and I would like to see how other people approached similar problems. If every time I have to install/load package to be able to explore function syntax I end up installing loads of packages I am never going to use. I have also tried
2003 May 08
3
Avoiding loops to spare time and memory
Is it possible to avoid the loop in the following function (or make the function otherwise more efficient) and can someone point me to a possible solution? (It would be great if hours could be reduced to seconds :-). # --------------------------------------------- RanEigen=function(items=x,cases=y,sample=z) { X=matrix(rnorm(cases*items),nrow=cases,byrow=F) S=crossprod(X-rep(1,cases) %*%
2009 Jul 13
1
Add grand mean to every entry in a matrix
Hi, I have a matrix: mymat <- matrix(runif(10*4), ncol=4) I wish to subtract the column means, down the colums, subtract the row means from the rows and add back the grand mean - all the means should be the means of mymat rather than of the new matrix. How can I do this? Any help much appreciated. Thanks Tom _________________________________________________________________
2009 Jul 08
1
heatmap.2: question regarding the "raw z-score"
Hi, I am analysing gene expression data using the heatmap.2 function in R and I was wondering what is the formula of the "raw z-score" bar which shows the colors for each pixel. According to that post: https://mailman.stat.ethz.ch/pipermail/r-help/2006-September/113598.html, it is the (actual value - mean of the group) / standard deviation. But, mean of which group? Mean of the gene
2002 Nov 15
2
Why no colSDs etc
Hi people, If there is a fn "colMeans" why isn't there a "colSDs" etc Thanks, Phil. -- Philip Rhoades Pricom Pty Limited (ACN 003 252 275) GPO Box 3411 Sydney NSW 2001 Australia Mobile: +61:0411-185-652 Fax: +61:2:8923-5363 E-mail: pri at chu.com.au -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2012 Mar 08
4
Correlation between 2 matrices but with subset of variables
Dear All, I have two matrices A (40 x 732) and B (40 x 1230) and would like to calculate correlation between them.  I can use: cor(A,B, method="pearson") to calculate correlation between all possible pairs. But the issue is that there is one-many specific mappings between A and B and I just need to calculate correlations for those pairs (not all). Some variables in A (proteins, say p1)
2008 Dec 30
3
Componentwise means of a list of matrices?
Dear useRs, I have a list, each entry of which is a matrix of constant dimensions. Is there a good way (i.e., not using a for loop) to apply a mean to each matrix entry *across list entries*? Example: foo <- list(rbind(c(1,2,3),c(4,5,6)),rbind(c(7,8,9),c(10,11,12))) some.sort.of.apply(foo,FUN=mean) I'm looking for a componentwise mean across the two entries of foo, i.e., the
2013 Jan 01
3
translate grouped data to their centroid
Given a data set with a group factor, I want to translate the numeric variables to their centroid, by subtracting out the group means (adding back the grand means). The following gives what I want, but there must be an easier way using sweep or apply or some such. iris2 <- iris[,c(1,2,5)] means <- colMeans(iris2[,1:2]) pooled <- lm(cbind(Sepal.Length, Sepal.Width) ~ Species,
2007 Sep 04
2
Howto sort dataframe columns by colMeans
I read from external data source containing several columns. Each column represents value of a metric. The columns are time series data. I want to sort the resulting dataframe such that the column with the largest mean is the leftmost column, descending in colMean values to the right. I see many solutions for sorting rows based on some column characteristic, but haven't found any
2002 Mar 17
5
compute variance of every column in a matrix without a loop
Is it possible to compute the variance of every column in a matrix without a loop? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
2012 Aug 06
2
deleting columns from a dataframe where NA is more than 15 percent of the column length
I have a dataframe of 10 different columns (length of each column is the same). I want to eliminate any column that has 'NA' greater than 15% of the column length. Do i first need to make a function for calculating the percentage of NA for each column and then make another dataframe where i apply the function? Whats the best way to do this.
2003 Sep 19
4
extracting columns with NA's
Hi All, How do I can delete from a matrix (or array) only those columns which have all their values set to NA? Cheers Antonio Rodriguez ---
2009 Sep 11
2
Alternative to Scale Function?
Hi, Is there an alternative to the scale function where I can specify my own mean and standard deviation? I've come across an interesting issue where this would help. I'm training and testing on completely different sets of data. The testing set is smaller than the training set. Using the standard scale function of R seems to introduce some error. Since it scales data WITHIN the