search for: data_m

Displaying 4 results from an estimated 4 matches for "data_m".

Did you mean: data_r
2009 Mar 02
3
Partial sum of a vector
I am trying to run a loop where I can sum parts of a matrix. For example, I want at each step in the loop to sum the the next 4-values of a vector. I tried to do the following but the result were wrong:   for (i in 4:T) { data_q[i-3,]=sum(data_m[i-3,]:data_m[i,]) }   can anyone please direct me on what should I do to run this loop properly   Thanks in advance [[alternative HTML version deleted]]
2012 Aug 23
1
Extracting data from dataframe with tied rows
...nth<-sample(1:12,100,replace=T) I have a dataset with records of individuals (id) , each with a distance (distance) & direction (bearing) recorded for each month (month). I want to find the largest distance per individual per month, which is easy with /tapply/ or /melt/cast (reshape)/, head(DATA_m<-melt(DATA,id=c("id","month"))) cast(DATA_m,id+month~.,max) OR na.omit(melt(tapply(distance,list(id,month),max))) *BUT THE CATCH IS* , I also want the the *corresponding* bearing for that maximum distance per month. I've tried the steps above plus using which.max() and...
2010 Sep 17
1
Data Cube in R from CSV
...es, the horizontals are all about a single figure and the verticals are all the data from a single company. I create the data cube with the reshape package from a 2D CSV file (which in turn is saved as a CSV file from an Excel File, which is the data master), which works so far very fine indeed. Data_m<-melt(Data, id=1:8, na.rm=TRUE) Data_cube<-cast(Data_m, Figure~Company~variable) The question now comes how one can browse through this object, as view gives it out as A.B and gets rather large. Does anyone know a way to save resulting data cubes elegantly, i.e. maybe so that there is a tool...
2009 Oct 09
4
Trendline for a subset of data
Dear all, I am using abline(lm ...) to insert a linear trendline through a portion of my data (e.g. dataset[,36:45]). However, I am finding that whilst the trendline is correctly displayed and representative of the data portion I've chosen, the line continues to run beyond this data segment and continues until it intersects the vertical axes at each side of the plot. How do I display the