Displaying 20 results from an estimated 200 matches similar to: "Help with a loop"
2012 Sep 20
3
Line over Boxplot
Very much a rookie at R, and have only recently started using it again so
pardon the simple question. I am trying to produce a box plot from one data
set and then overlay a line plot from another data set. The box plot data
set is made up of 20 sets of 30 data points, or 600 total data points. The
line has only 30 total data points. The box plot is plotting fine, but for
some reason, the line plot
2010 Jul 12
1
Custom nonlinear self starting function w/ 2 covariates
Hello,
I'm trying to adjust a non linear model in which the biological response
variable (ratio of germinated fungus spores) is dependent on 2 covariates
(temperature and time). The response to temperature is modeled by a kind of
beta function with 2 parameters (optimal and maximum temperatures) and the
time function is a 2-parameter Weibull. Adjustments with nls or gnls work,
but I need to
2005 Jan 31
2
coercing a list to a data frame, lists in foreloops
I have a set of time-series climate data with missing entries. I need to add
rows for these missing entries to this data set. The only way I know to do
this is unsing a foreloop, but this won't work on a list. I've tried to
convert the list to a data frame, but that won't happen, either.
I want to fill rows in this table:
> newtest[10:15,]
yrmos yearmo snow.sum snow.mean
2010 Jul 26
2
Concatenate a mix of numbers and letters to create a vector name
Dear all,
I am trying to create a vector name, for example tmax.195012 from tmax., 1950 and 12. Obviously I don't wish to simply type it because the 3 name components are changing in each iteration within a loop. Is there any way of concatenating those 3 components (which are a mixture of numbers and letters)?
Thanks for reading,
Panos
2012 Mar 19
3
Issue with asin()
Hello everyone,
I am working for a few days already on a basic algorithm, very common in
applied agronomy, that aims to determine the degree-days necessary for a
given individual to reach a given growth stade. The algorithm (and context)
is explained here: http://www.oardc.ohio-state.edu/gdd/glossary.htm , and
so I implemented my function in R as follows:
DD <- function(Tmin, Tmax, Tseuil,
2023 Feb 28
1
vector a partir de los valores de una tabla
Muy buenas, necesito crear un vector a partir de los valores de una tabla
como la de abajo. Debe ser algo muy fácil pero no lo encuentro en la web.
Gracias,
Manuel
246, 345, 401, 131,125, 69 a partir de:
TS1 TS2 TS3 TS4 TS5 TS6
246 345 401 131 125 69
[[alternative HTML version deleted]]
2004 Sep 06
1
A naive lsoda question....
Hello,
I am an R newbie, trying to use lsoda to solve standard
Lotka-Volterra competition equations. My question is: how do I
pass a parameter that varies with time, like say, phix <- 0.7 +
runif(tmax) in the example below.
# defining function
lotvol <- function(t,n,p){
x <- n[1]; y <- n[2]
rx <- p["rx"]; ry <- p["ry"]
Kx <-
2017 Aug 19
4
My very first loop!! I failed. May I have some start-up aid?
Dear all,
I have a data similar to this:
myframe<- data.frame (ID=c("Ernie", "Ernie","Ernie","Ernie"),
Timestamp=c("24.09.2012 08:00", "24.09.2012 09:00", "24.09.2012 10:00",
"25.09.2012 10:00"), Longitude=c("8.481","8.482","8.483","8.481"),
2016 Apr 20
1
Use multiple cores on Linux
I am trying to run the following code in R on a Linux cluster. I would like
to use the full processing power (specifying cores/nodes/memory). The code
essentially runs predictions based on a GAM regression and saves the
results as a CSV file for multiple sets of data (here I only show two).
Is it possible to run this code using HPC packages such as
Rmpi/snow/doParallel? Thank you!
2009 Nov 17
1
How to plot an image in R
Dear all
Im new in R
I have a necdf data set that I want to plot :
this is my data set
[1] "file Tmax.DJF.daily.1981_1999.echama2.nc has 4 dimensions:"
[1] "longitude Size: 127"
[1] "latitude Size: 110"
[1] "ht Size: 1"
[1] "t Size: 1680"
[1] "------------------------"
[1] "file Tmax.DJF.daily.1981_1999.echama2.nc has 1
2012 Apr 13
3
A little exercise in R!
Greetings all!
A recent news item got me thinking that a problem stated
therein could provide a teasing little exercise in R
programming.
http://www.bbc.co.uk/news/uk-england-cambridgeshire-17680326
Cambridge University hosts first European 'maths Olympiad'
for girls
The first European girls-only "mathematical Olympiad"
competition is being hosted by Cambridge
2018 Jun 19
3
Paquete dismo, cálculo coeficiente de variación
Estimados erreros,
Estoy intentando entender como calcula el paquete dismo (
https://cran.r-project.org/web/packages/dismo/index.html) un coeficiente de
variación. Os pongo un ejemplo:
tmin <- c(10,12,14,16,18,20,22,21,19,17,15,12) # temperatura mínima media
mensual de un año
tmax <- tmin + 5 # temperatura máxima media mensual de un año
prec <- c(0,2,10,30,80,160,80,20,40,60,20,0)
2017 Aug 19
0
My very first loop!! I failed. May I have some start-up aid?
Thank you for providing the example code... for the request of running it
multiple times it would have helped if you could have confirmed that the
example ran through without errors... there were a lot of mistakes in it.
Look into using the reprex package to check your example next time.
I don't do this kind of analysis... I really don't know what to expect
from the functions. The
2006 May 11
1
Maximum value of two columns
Hello -- Given the 10x2 matrix below, my goal is to create a vector
which contains the maximum of column 1 and column 2, or the only value
if there is an NA in one column. I experimented with max.col without
success. Thanks. --Dale
> tmax.m
tmaxhme tmaxer
[1,] 101.0 99.8
[2,] 102.5 99.0
[3,] 100.6 98.4
[4,] NA 100.5
[5,] 101.0 99.4
[6,] NA
2018 Jun 19
2
Paquete dismo, cálculo coeficiente de variación
Hola,
en la misma definici?n de la funci?n:
# P15. Precipitation Seasonality(Coefficient of Variation)
# the "1 +" is to avoid strange CVs for areas where mean rainfaill is < 1)
p[,15] <- apply(prec+1, 1, cv)
Un saludo,
Jorge
On Martes, 19 de Junio de 2018 13:07:27 Marcelino de la Cruz Rot escribi?:
> Hola Jaume:
>
> Si miras el c?digo de biovars() ver?s que la
2017 Aug 19
0
My very first loop!! I failed. May I have some start-up aid?
[answers inline]
On 18 August 2017 at 20:08, Dagmar <Ramgad82 at gmx.net> wrote:
>
> myframe<- data.frame (ID=c("Ernie", "Ernie","Ernie","Ernie"),
> Timestamp=c("24.09.2012 08:00", "24.09.2012 09:00", "24.09.2012 10:00",
> "25.09.2012 10:00"),
2013 Apr 09
2
R crash
I have a generalized linear model to solve. I used package "geepack". When
I use the correlation structure "unstructured", I get a messeage that- R
GUI front-end has stopped working. Why this happens? What is the solution?
The r codes are as follows:
a<-read.table("d:/bmt.txt",header=T")
2005 Jan 25
1
chron: parsing dates into a data frame using a forloop
I have one data frame with a column of dates and I want to fill another data
frame with one column of dates, one of years, one of months, one of a unique
combination of year and month, and one of days, but R seems to have some
problems with this. My initial data frame looks like this (ignore the NAs in
the other fields):
> mans[1:10,]
date loc snow.new prcp tmin snow.dep tmax
1
2009 Jul 07
2
Tmax Window(a propietary OS) using Wine?
Hi, Im posting here the next doubt:
Yesterday a korean company has released a new OS which is compatible with MS Windows Apps. As they state, they are a propietary OS, and i cant see any GPL code or SVN repository.Of course my lack of Korean can help to not find the open source code,but the little im able to read seems they arent going to release any source code.
I know that is quite difficult
2002 Nov 25
3
Full enumeration, how can this be vectorized
Hi all,
I am currently using the code snippet below to minimize a function which I
wasn't able to minimize properly with optim (cliffy surface, constraints,
poles). Obviously this iteration is probably the poorest way of implementing
such a function and it is expectedly slow. I've already written some
vectorized functions, but I'm afraid that I'm missing the "big