similar to: manipulating data of several columns simultaneously

Displaying 8 results from an estimated 8 matches similar to: "manipulating data of several columns simultaneously"

2012 Jan 11
3
Accomplishing a loop on multiple columns
Hello, I have a question concerning ?for loops? on multiple columns. I made 91 columns with results (all made together with a for loop) and I want to us lm to fit the model. I want to compare the results of all these calculated columns (91) with one column with observed values. I use the function lm to fit the model and calculate r.squared. I manage to do this for each column separately: For
2012 Jan 17
2
result numeric(0) when using variable1[which(variable2="max(variable2)"]
Dear all, I have a question about the knowing for which row I have the max value of one of my variables. I calculated the Rsquared for different columns and made a list to gather them. I unlisted this list to create a vector with this values. I want to know for which column I have the max value of Rsquared. The columns were always named in the same way. They always start with results4$depth_
2012 Jun 05
1
nls: how do you know if the model is significant?
Hi all, I'm struggling with nls. How do you know if your model is significant? For a lm, you get a p-value, but you don't get it for a nls. Is there a way to calculate it? For a lm I use this: a<-summary(lm(model ~obs)) f.stat<-a$fstatistic p.value<-1-pf(f.stat["value"],f.stat["numdf"],f.stat["dendf"]) Is there something similar for a nls?
2012 Feb 13
2
different way for a for loop for several columns?
Hi, I have a question about repeating something for several columns. I calculated a lot of values for different objects. The values are normally calculated step-wise for every day for each object. With this obtained data frame, I make further calculations. Here I have to calculate some things and I have to take into account the years because I want a number for each year. I do these first for one
2012 Jun 04
2
Non-linear curve fitting (nls): starting point and quality of fit
Hi all, Like a lot of people I noticed that I get different results when I use nls in R compared to the exponential fit in excel. A bit annoying because often the R^2 is higher in excel but when I'm reading the different topics on this forum I kind of understand that using R is better than excel? (I don't really understand how the difference occurs, but I understand that there is a
2012 Mar 13
1
size of graphs when using multiple figures by row
Hi all, I have a basic question concerning graphs in R. I?m using the par() function and I?m working with multiple figures by row (mfrow) but my the hight of my figures become compressed. I have 4 rows and 2 columns (because I want to plot 8 histograms (freq = FALSE ) on it. I know I can adapt my margins with for example ?oma? and ?mai? but I don?t know how to choose the size of the figure? I
2012 Feb 20
1
apply with as function ifelse with 2 logical conditions
Hi all, I have a question concerning using several conditions in an ifelse function used as the function in apply. I want to create a new value with the function ifelse ? object which can be coerced to logical mode ?test[n,] >1 & test[n-1,]==0? With n I mean the row. I don?t know how I could do this without a loop. I want to avoid the usage of loops and was thinking about apply. This
2012 Feb 15
2
function similar to ddply? + calculations based on previous row
Hi all, I was wondering if there is a function kind of similar that splits a dataframe, applies a function to each row and returns in a data frame. I know ddply but this one isn?t useful in this situation. I have a dataframe with values for each day (rows) for different objects (columns). I have values for several years. Now, I want to do calculations on only the data of that year. With the