Displaying 20 results from an estimated 1000 matches similar to: "colMeans in a data.frame with numeric and character data"
2007 Oct 22
3
median value dataframe coming from multiple dataframes
Hi all,
I am not a skillful R programmer and has I am handling with large dataframes (about 30000 x 300) I am in need of an efficient function.
I have 4 dataframes with the same dimension. I need to generate other dataframe with the some dimension than the others where in each position it has the median value of the 4 values in the same position coming from the 4 dataframes.
Grateful by your
2007 Jul 20
1
Column-mean-values for targeted rows
Hi all,
I'm handling massive data.frames and matrices in R (30000 x 400).
In the 1st column, say, I have 0s and 1s indicating rows that matter; other columns have probability values.
One simple task I would like to do would be to get the column mean values for signaled rows (the ones with 1)
As a very fresh "programmer" I have build a simple function in R which should not be very
2008 Nov 06
2
comparing matrices using max or min
Dear all,
I have 3 matrices with the same dimension, A,B,C and I would like to produce
a matrix D where in each position would retrieve the max(or min) value along
A,B,C taken from the same position.
I guess that apply functions should fit, but for matrices objects I am not
getting it.
thanks in advance,
Diogo André Alagador
[[alternative HTML version deleted]]
2006 Dec 06
2
Usage of apply
Dear R Users,
Are there any documents on the usage of apply, tapply,
sapply so that I avoid explicit loops. I found that these
three functions were quite hard to be understood. Thank you
in advance.
--
Jin
2007 Jul 20
3
R CMD SHLIB problem [make: *** No rule to make target ]
Hy all,
I apologize for my ingenuity in regard to interfaces in R, but I do need it for my work. In that respect I took a simple and small example from the net (the "hello world", one) to interface R with C.
I have a Windows XP OS using R.2.5.0 and in that regard I have installed the Perl and RTools files to my PC. I also wrote a proper path file, as suggested.
The C program is:
2007 Nov 06
2
wilcox test on two data frames
Hi all,
Basically I have 2 data frames with equal dimension and I want to apply the wilcox.test to compare columns in the same position (i.e. 1st of df.A with 1st of df.B, 2nd of df.A with 2nd of df.B,...).
Anyone give me an hint on this, as I think it is nicer to avoid loops, specially for huge dataframes (30000 x 200)
Thanks in advance,
Diogo André Alagador
Portugal
[[alternative HTML
2009 May 16
3
How to save R "clean" sessions in BATCH mode?
Thanks a lot for all of you that have reply me about opening and
ending R workspaces in BATCH mode. However replies were a king general
and I?m afraid I could not take the entire message from them.
Therefore I chose to expose here a representative fraction of my work.
I have 50 Rdata files (F1,F2,F3,F4,
,F50) with objects inside.
I need to:
open F1:
- perform some simple operations
2008 Mar 02
1
an efficient pairwise matrix cell's comparison function
To all,
I am undergoing an analysis involving big matrices of about 30000x200 which
I have to handle in a more efficient way. So I would like some advice to
build such efficient function to deliver the following result:
- starting with 2 matrices of the same dimension (eg. A and B)
0 0 3 5 6 0 0 5
A= 0 0 6 4 B= 0 4 3 5
2008 Oct 31
4
[ifelse] how to maintain a value from original matrix without probs?
Dear all,
I have a matrix with positive and negative values.
>From this I would like to produce 2 matrices:
1st - retaining positives and putting NA in other positions
2nd - retaining negatives and putting NA in other positions
and then apply rowMeans for both.
I am trying to use the function ifelse in the exemplified form:
ifelse(A>0,A,NA)
but by putting A as a 2nd parameter it
2008 Aug 21
1
[dist]how to analise a large matrix?
Hi all,
I have a matrix of about 100.000?x 4?that I need?to classify using
euclidean metric. For that I am using dist?or daisy functions, but I
am afraid that the message: Error in vector("double", length) : vector
size specified is too large, means too much lines.
Can anyone suggest me how should I analyse this matrix?
Thanks in advance,
Diogo Andr? Alagador
MNCN,CSIC, Madrid, Spain
2009 Apr 03
2
Basic doubts on the use of several script files in R batch mode
I already searched for information regarding the batch file operations
within R. But I could not locate the information I need.
Basically I have a doubt regarding the procedures on the batch use of
several script files (*.R).
How can I do this?
How can I define the order of files?
My intention is to programme openings, math operations and savings of
*.Rdata sessions, but in a sequential
2011 Aug 02
1
Using Function
Hi,
I have some simple statistics to calculate for a large
number of variables.
I created a simple function to apply to variables.
I would like the variable name to be placed automatically.
I tried the following function but is not working.
desc = function(x){
media = mean(x, na.rm=T)
desvio = sd(x, na.rm=T)
cv = desvio/media*100
1999 Oct 25
1
trouble reading in datasets
Dear All,
I was trying to follow some of the examples in Venables and Ripley "Modern applied ... with S-plus"
I have downloaded a copy of the iris data set and loaded into R. :
however I cannot use the apply command (from p47):
> apply (iris, 2 ,mean)
Error in sum(..., na.rm = na.rm) : invalid "mode" of argument
> apply (iris, c(2) ,mean)
Error in sum(..., na.rm =
2023 Jan 29
2
[REGRESSION] GM20B probe fails after commit 2541626cfb79
On Fri, 27 Jan 2023 at 20:42, Diogo Ivo <diogo.ivo at tecnico.ulisboa.pt> wrote:
>
> On Fri, Jan 27, 2023 at 04:00:59PM +1000, Ben Skeggs wrote:
> > On Fri, 20 Jan 2023 at 21:37, Diogo Ivo <diogo.ivo at tecnico.ulisboa.pt> wrote:
> > >
> > > On Wed, Jan 18, 2023 at 11:28:49AM +1000, Ben Skeggs wrote:
> > > > On Mon, 16 Jan 2023 at 22:27, Diogo
2005 Apr 01
2
Error in colMeans ... what's wrong with my data?
Having searched and searched I still haven't found what's the problem with my data (I've attached the relevant file).
Every time I tried to use the CANCOR-Function I got error messages.
So I turned to check my two sets of variables separately by using the "colMeans"-Function. With one set no problem .. but with the other.
My input :
> struktur <-
2011 Mar 28
0
Bootstrapping the colMeans statistic
I have a fair bit of experience with S-Plus and have been asked to port
some of my S-Plus bootstrapping functions to R, to which I am relatively
new, Needless to say, I've run into some problems. In particular, I need
to perform bootstrap resampling of the colMeans function using a moving
blocks bootstrap, where the blocks are row indices. It's easy to build a
function that allows me
2012 Dec 05
8
Error: Could not request certificate: Connection refused - connect(2)
Hi all,
I am new at puppet and Im using the puppet learning tutorial. I execute
until Basic agent/master puppet. Everything worked ok but after 2 or 3
days, running the command "puppet agent --test", start throw the error in
subject. That left me with the following questions:
how to puppet agent connect to master without service started on master?
If this connection is possible (
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
2009 Sep 28
1
colMeans()
Hello,
I use the function rowMeans(x,na.rm=T). The result is the mean of valid
values in each row, with NA removed. A for me very important information
is, from how many valid "n" this mean has computed.
The thing is, that I apply this function on many millions of rows, so
the time it takes is multiplied by this factor! (so getting this with
"rowSums(is.na(x))" it takes
2012 Dec 24
2
colmeans not working
[text file is also attached in case you find the format of email difficult to understand]
Dear useRs,You must all the planning for the christmas, but i am stucked in my office on the following issue
i had a file containg information about station name, year, month, day, and discharge information. i opened it by using
following command
> dat1<-read.table("EL.csv",header=TRUE,