similar to: appending data to a dataframe

Displaying 20 results from an estimated 400 matches similar to: "appending data to a dataframe"

2004 Aug 11
2
Advice on picking a regression method
Dear R-users, There are tons of methods out there for fitting independant variables to a dependent variable. All stats books tell you about the assumptions behind OLS (ordinary least squares) and warn against abusive use of the method (which many of us do disregard by lack of a better knowledge). Most introductory text books stop there and don't tell you what the next best option might be. I
2004 Aug 09
2
displaying computation outputs inside "for" loops
Dear R-users, I am puzzled by for loops and am kind of ashamed to ask because it is so simple. There must be something I am missing in the way they are executed. Basically, I would like to iterate a given number of time and generate a bunch of stats (that's what loops are designed for, right?). Before doing this I simply want to test simple procedure and see if they work (ie got the syntax
2006 Oct 10
1
How to assign a rank to a range of values..
>From the following: basin.map <- readAsciiGrid("c:/temp/area.asc", colname="area") I have a SpatialGridDataFrame which has the x and y cordinate of a cell, and the drainage area of that cell. There are many cells with a low drainage area (in my case, 33000 with an area of 37.16) and one cell with the highest drainage area (again, in my case, a drainage area of of
2007 May 16
1
Problem with Sweave
I am using R 2.5 on a Linux Redhat platform. I can successfully run some example *.Rnw files through Sweave and generate pdf files. When I try my own example file, "test.Rnw": \documentclass[a4paper]{article} \title{Test Sweave Example} \author{Thomas Adams} \begin{document} \maketitle In this example we embed parts of the examples from the \texttt{boxplot} and \texttt{lattice}
2004 Sep 01
3
coercing a string naming to a variable name and return value
Hi all, I haven't been able to find how to assess a variable who's name is constructed with paste. The problem is following: In a data frame, there are 12 columns whose title vary only by a digit, all other part being equal. I would like to compute a operation on a subset these variables and parse them in turn. the data frame "basin.param" contains columns called ratio1,
2004 Aug 02
0
averaging 3D datasets
Dear R-users, I've spent most of the day reading R documentation at length but couldn't find something perhaps obvious. I have a dataset made of 3 morphometric variables for a series of watershed [log(slope); log(drainage_area); distance_to_outlet] My aim is to predict the value of log(slope) for pairs of [drainage_area; distance_to_outlet] (sounds like a plain linear model fitting,
2006 Oct 08
1
Probability of exceedance function question
I'm trying to calculate a cumulative area distribution (graph) of drainage areas. This is defined as P(A > A*). Simple in principle. I can do this in excel, with "COUNTIF", which will count the number of cells in the row "area" that have area A, then determine, for each cell in the row "area, how many cells exceede that area, then dividing that number by the total
2006 May 03
2
Nested model and variance partitioning
Dear R users, I face to a nested pattern and despite the numerous examples in the help I am still confused. I sampled bugs in different habitats within sites which were within rivers themselves within different regions. The habitat correspond to different substrata (not systematically present in all sites). For rivers and sites, I have environemental variables (e.g. altitude and slope of
2010 Aug 25
1
SEM : Warning : Could not compute QR decomposition of Hessian
Hi useRs, I'm trying for the first time to use a sem. The model finally runs, but gives a warning saying : "In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : Could not compute QR decomposition of Hessian. Optimization probably did not converge. " I found in R-help some posts on this warning, but my attemps to modify the code didn't change
2004 Aug 09
1
Follow-up Q Re: displaying computation outputs inside "for" loops
I have a somewhat related question. A while back I was doing some simulations using for() loops, and I wanted to keep track of the iterations using a line of code quite similar to what Dimitris presented below. Instead of printing the iteration message at the end of each iteration (actually, at the end of every 100th), nothing was printed until the for() loop was complete, and *then* all
2007 Jun 12
0
nlme model
I am having trouble figuring out the right form for the nlme arguments. I do have examples in Modern and Applied Statistics with S and from other sources, but I still can't figure it out. I am trying to estimate species richness (sr) in streams across minnesota. My predictor variables are depth (d), habitat diversity (habdiv), drainage area (da) and an indicator variable representing the
2004 Jul 27
2
computing differences between consecutive vector elements
Dear R-users, I am a newbie to R so please excuse this naive question for which I couldn't seem to find online answers. I have this data frame containing a series of locations through time (x,y,z,t). I would like to compute the difference in x, y and z between t-1 and t. Sounds easy enough, but how on earth does one loop through vector elements and compute this difference? Thanks Thomas
2017 Oct 05
3
working with ordinal predictor variables?
I'm trying to develop a linear model for crop productivity based on variables published as part of the SSURGO database released by the USDA. My default is to just run lm() with continuous predictor variables as numeric, and discrete predictor variables as factors, but some of the discrete variables are ordinal (e.g. drainage class, which ranges from excessively drained to excessively poorly
2004 Jul 28
5
using Rterm under cygwin, no possiblity to delete characters
Dear R-users, When I call Rterm from cygwin, I have no options but typing the exact syntax the first time. If I happen to hit the "delete" key (backspace), R dies when I press enter saying : Error: ... (error concerning the function on the last line of text) Execution halted Perhaps some of you have experienced this and found work arounds? One has to be pretty good to type without
2010 May 29
1
Help with R graphics
I need to make a plot illustrating main characterisitig of river drainage data. For this I have 2 questions: how can I rotate a histogram -90? (or 270?) (like the horizontal=TRUE with plot)? how can I use split.screen to produce 3 plot with uneuqal size (1/5, 2/5, 2/5 of the screen width)? thank you very much in advance for your help fabian
2017 Oct 05
0
working with ordinal predictor variables?
I would consider this is a question for a statistics forum such as stats.stackexchange.com, not R-help, which is about R programming. They do sometimes intersect, as here, but I think you need to *understand what you're doing* before you write the R code to do it. Obviously, IMO. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and
2007 Nov 14
1
reading tables from url
I'm trying to read some web tables directly into R. These are both genome sequencing projects (eukaryotes and metagenomes) from NCBI and look very similar; however, only the first one works. http://www.ncbi.nlm.nih.gov/genomes/leuks.cgi http://www.ncbi.nlm.nih.gov/genomes/lenvs.cgi I added ?dump=selected to the end of the url string to get a tab- delimited file (which is what happens
2007 Jul 18
0
multicollinearity in nlme models
I am working on a nlme model that has multiple fixed effects (linear and nonlinear) with a nonlinear (asymptotic) random effect. asymporig<-function(x,th1,th2)th1*(1-exp(-exp(th2)*x)) asymporigb<-function(x,th1b,th2b)th1b*(1-exp(-exp(th2b)*x)) mod.vol.nlme<-nlme(fa20~(ah*habdiv+ads*ds+ads2*ds2+at*trout)+asymporig(da.p,th1,th2)+ asymporigb(vol,th1b,th2b),
2007 Nov 02
1
lme model with replicates within a random factor
Dear all, I wonder if anyone can help me with specifying a right model for my analysis. I am a beginner to lme methods. I was unfortunately not able to find a solution to my problem on my own. Data structure: I have sampled monthly 6 basins during two hydrological cycles, and I have taken several (2 to 4) samples (“replicate”) for each basin and month. I’m trying to relate Shannon diversity
2012 May 17
3
New Eyes Needed to See Syntax Error
One of many scripts to produce 4 lattice plots on one page keeps throwing an error. I've tried manipulating the file to eliminate the error, but have not been able to do so. The error is: > source('bicarb.R') Error in source("bicarb.R") : bicarb.R:15:1: unexpected symbol 14: 15: hco33 ^ The 'h' is in column 0 so the caret would be column -1, but it's