search for: nyears

Displaying 13 results from an estimated 13 matches for "nyears".

Did you mean: years
2004 Nov 11
6
scan or source a text file into a list
I've ported somebody else's rather cumbersome Matlab model to R for colleagues that want a free build of the model with the same type of I/O. The Matlab model reads a text file with the initial parameters specified as: C:\Data\Carluc\Rport>more Params.R # Number of years to simulate nYears = 50; # Initial year for graphing purposes year0 = 1970; # NPP/GPP ratio (cpp0 unitless) fnr = 0.30; # Quantum efficency qe = 0.040; That is, there are four input variables (for this run - there can be many more) written in a way that R can understand them. In R, I can have the model source the p...
2006 Oct 27
2
Question: xyplot panel configurations for Trellis package
Hi, I am new to R community and I have a question on panel configurations in the Trellis package. Particularly, I have the following code: require(lattice) plotTable <- NULL Date <- seq(as.Date("2006-11-01"), as.Date("2009-12-01"), by = 1) nYear <- length(unique(format(Date,"%Y"))) plotTable$Date <- as.Date(paste(unique(format(Date, "%Y-%m")),
2002 Apr 06
1
read.table and trouble
...'m admitting defeat. Can anybody help? Object example3 has been read in using read.table. The statement works fine in S-Plus. When I run the same statement in R the column Prefix, which is read in using the as.character coercion, is wacky. It reads in as numeric. > example3 nRows nWaves nYears Noise Amp Freq AmpTwo FreqTwo Prefix 1 1 1 1000 0.02 0.01 2 NA NA "test" 2 2 1 1000 0.02 0.02 2 NA NA "test2" 3 3 1 1000 0.02 0.03 2 NA NA NA 4 4 1 1000 0.02 0.04 2 NA NA...
2005 Dec 13
4
Ploting graphics using X tints from a color
Hi, I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || My idea is that each year is plotted with a different tint of red. Older year (lightest) -> Later year (darkest). I've managed to plot this with different scales of grays simply by doing: palette(gray(length(years):0/length(years))) before the plot and for each
2011 Apr 19
2
Markov transition matrices , missing transitions for certain years
...r a way around it that would be most appreciated! Thank you! -------------- Function requires the commands already listed above: FMAT <- matrx(0, nrow=4, ncol=4, byrow=TRUE) #This is the matrix that will store the frequency of each possible transition occurring over the 4 years nboxes <- 4 nyears <- 4 for(row in 1:nboxes) { for(col in 1:(nyears-1)) { FMAT[boxes[row,col+1], boxes[row,col]] <- boxes[boxes[row, col+1], boxes[row,col]] #This is the line of code I have been struggling with an am unsure about. I have tried #various versions of this and keep getting an assortment of error m...
2009 Nov 05
3
performing operations on a dataframe
Hey all, I feel like the solution to this problem should be relatively simple, but for some reason I can't find answers or come up with my own solution. Given the dataframe: (SpA and SpB not important, want to look at distribution of cooccurance for each year) Year SpA SpB Coocc 2000 0 2000 2 2000 1 2001 8 2001 2 2001 0 2001 0 2002 1 2002 2 How can I apply different functions to
2011 Apr 01
1
filled contour plot with contour lines
I'm stumped, can anyone find my error in this sequence. for(j in 1:(varsize[4]-1)) temp <- get.var.ncdf(nc=input, varid="p_foraging",c(1,1,j),c(varsize[1],varsize[2],1)) filled.contour(x, y, temp, color = terrain.colors, plot.title = title(main = paste("Everglades Wood Stork Foraging Potential \nYear", (2000+j)), xlab =
2009 Aug 04
0
Efficient coding
...sp,] dmnd <- tsrSUB[is.na(tsrSUB$cDeviceClass),] if(nrow(dmnd) != 1) warning(paste("cSpillingPointID", sp, "has more than one demand time Series. Used first.")) tsrValCount <- getTimeSeries(chn, tsrSUB[!is.na(tsrSUB$cDeviceClass),]$cTimeSeriesID, nDaysBack = 366*nyears) tsrValDmnd <- getTimeSeries(chn, dmnd$cTimeSeriesID[1], nDaysBack = 366*nyears) sequence <- timeSequence(from = format(start(tsrValDmnd), '%Y-%m-%d'), to = format(end(tsrValDmnd), '%Y-%m-%d'), by = 'day') if(format(start(tsrValDmnd), '%H') != '00...
2011 Jul 07
1
Select element out of several ncdf variables
Hi there I'm working with ncdf data. I have different dataset for 4 runs, 4 seasons and 3 timeslices (48 datasets in total). The datasets have the following dimensions: 96 longitudes, 48 latitudes and 30 time steps. To read all of them in, I wrote the following loop: runs <- c("03","04","05","06") years <- c(1851,1961,2061) seasons <-
2009 Apr 26
7
Bumps chart in R
Hi there, I would like to make a 'bumps chart' like the ones described e.g. here: http://junkcharts.typepad.com/junk_charts/bumps_chart/ Purpose: I'd like to plot the proportion of people in select countries living for less then one USD pr day in 1994 and 2004 respectively. I have already constructed a barplot - but I think a bumps chart would be better # The barplot and data
2012 Sep 04
3
Comparing Von Bertalanffy Growth Curves
I am trying to compare Vbert growth curves from several years of fish data. I am following the code provided by: http://www.ncfaculty.net/dogle/fishR/gnrlex/VonBertalanffy/VonBertalanffy.pdf. Specifically the section on VBGM Comparisons between groups. ? This code is pretty cut and dry. I am able to run it perfectly with the "fake" data that is provided. But when I run it with my own
2008 Oct 04
3
ggplot2: how to combine position=stack and position=dodge in a single graph?
Hi ggplot experts, I need to plot two time series of stacked data: a barchart with bars for each month. To compare the data of two years I need to combine both time series with in a single graph via position=doge. How should I do that? I tried the following scenario: I added two layers with the time series of the stacked data for both years. That worked well exept the bars are obscuring each
2012 Sep 13
6
[newbie] aggregating table() results and simplifying code with loop
Dear all, I'm looking for primary help at aggregating table() results and at writing a loop (if useful) My dataset ( http://goo.gl/gEPKW ) is composed of 23k rows, each one representing a point in the space of which we know the land cover over 10 years (column y01 to y10). I need to analyse it with a temporal sliding window of 5 years (y01 to y05, y02 to y06 and so forth) For each period