Displaying 16 results from an estimated 16 matches for "rafa_moral2004".
2009 Sep 08
4
barplot with lines instead of bars
Dear useRs,
I want to plot the following barplot with lines instead of bars. Is there a way?
data <- data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48)))
d <- t(data[,2:4])
barplot(d, beside=TRUE)
Regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo
2009 Aug 19
2
line plot
Dear useRs,
How can I draw a barplot, but instead of bars, I'd get lines?
Thanks,
Kind regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo spam]]
[[alternative HTML version deleted]]
2009 Aug 20
3
categorized barplot
Dear useRs,
I can't seem to find out how to categorize my histogram.
I have the following dataset:
Time??????????? First.day? Second.day
08:00-10:00??????? 9?????????? ? 8
10:00-12:00?????? 13???????? ? 15
12:00-14:00??????? 9?????????? ? 9
14:00-16:00???????10????????? ? 9
I attached a jpeg file to this e-mail containing the sketches.
What I'd like to do is a barplot (or histogram),
2010 Jan 02
2
help with for loop
Dear useRs,
I want to write a function that generates all the possible combinations of diff().
Example:
If my vector has length 5, I need the diff() until lag=4 ->
c(diff(my.vec), diff(my.vec, lag=2), diff(my.vec, lag=3), diff(my.vec, lag=4))
If it has length 4, I need until lag=3 ->
c(diff(my.vec), diff(my.vec, lag=2), diff(my.vec, lag=3))
So, it must be until lag=(length(my.vec)-1).
2009 Jan 14
3
Logical function to turn missing values to 0's
I have a dataset which contains some missing values, and I need to replace
them with zeros. I tried using the following:
x <- matrix(data=rep(c(1,2,3,NA),6), ncol=6, nrow=6)
y <- matrix(data=0, ncol=ncol(x), nrow=nrow(x))
for(i in 1:nrow(x)) {
for(j in 1:ncol(x)) {
y[i,j] <- ifelse(x[i,j]==NA, 0, x[i,j])
}}
But y returns an NA matrix.
I'd appreciate any help.
--
View this
2009 Mar 12
8
help with loop
Dear useRs,
I'm trying to write a loop to sum my data in the following way:
(the second - the first) + (the third - the second) + (the fourth - the third) + ...
for each column.
So, I wrote something like this:
c <- list()
for(i in 1:ncol(mydata)) {
for(j in 2:nrow(mydata)) {
c[[i]] <- sum(yc[j,i] - yc[(j-1),i])
}}}
As for the columns it works pretty fine, but it only
2009 Jul 13
1
math expressions in graphs
Dear useRs,
I want to put a math expression in the ylab in my plot which should be a Delta and a 'y' with a trace and a hat above it and a 't' as subscription.
How could I manage to do it?
Thanks in advance,
Regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo spam]]
[[alternative HTML version deleted]]
2009 Sep 07
2
model simulation
Dear useRs,
Is there a package or a function able to simulate models with sets of differential equations?
Where we could input our model and give R some value to start with and it would generate the graphs?
Regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo spam]]
[[alternative HTML version deleted]]
2009 Nov 16
2
Conditional statement
Dear useRs,
I wrote a function that simulates a stochastic model in discrete time.
The problem is that the stochastic parameters should not be negative and sometimes they happen to be.
How can I conditionate it to when it draws a negative number, it transforms into zero in that time step?
Here is the function:
stochastic_prost <- function(Fmean, Fsd, Smean, Ssd, f, s, n, time, out=FALSE,
2010 Jan 22
1
confidence intervals for mean (GLM)
Dear useRs,
How could I obtain the confidence intervals for the means of my treatments, when my data was fitted to a GLM?
I need the CI's for the Poisson and Negative Binomial distributions.
Here's what I have:
mydata1 <- data.frame('treatments'=gl(4,20), 'value'=rpois(80, 1))
model1 <- glm(value ~ treatments, data=mydata1, family=poisson)
means1 <-
2010 Dec 09
1
2 plots with different scales in the same graphical window
Dear useRs,
I have two sets of data that I would like to plot in the same window, but their
ranges are really different, e.g.
a <- c(0.2, 0.5, 0.8, 0.3, 0.4, 0.5, 0.2, 0.2, 0.3)
b <- c(100, 2000, 800, 200, 100, 50, 4, 2, 0)
If I do
plot(a, ty='l'); points(b, ty='l')
I won't be able to see sequence b.
However, if I do
plot(b, ty='l'); points(a, ty='l')
2009 May 13
0
Mann-Kendall test
Dear useRs,
I've been trying to run a Mann-Kendall test in my data in order to detect trends.
I studied the examples given at the Kendall package and I can understand pretty well how it works on time-series data.
However, my data consists of values in different sites per year, as I display below;
Year 1 | Year 2 | Year 3 | ...
Site 1 x x x ...
2009 Oct 26
1
fit an exponential curve
Dear useRs,
I have the following plot:
pos <- c(27/44, 11/32, 8/40, 4/42, 3/40, 4/40, 2/40)
tmin <- c(15.8, 12.6, 10.5, 2.4, 5.2, 8.5, 7.9)
plot(tmin, pos)
I would like to fit an exponential curve to it.
How could I be able to do this?
Thanks in advance,
Rafael.
____________________________________________________________________________________
[[elided Yahoo spam]]
2009 Sep 25
1
simulating a model
Dear useRs,
I have written an ecological model, based on the epidemiology SIR model.
I've been trying to simulate it in R.
However, I can't simulate it properly.
Two guesses: my script isn't right; I'm not setting the parameters properly
I have uploaded an image to the model here:
http://img24.imageshack.us/img24/743/imagemutr.jpg
The script I am using is as it follows:
2010 Jan 19
1
splitting a factor in an analysis of deviance table (negative binomial model)
Dears useRs,
I have 2 factors, (for the sake of explanation - A and B), with 4 levels each. I've already fitted a negative binomial generalized linear model to my data, and now I need to split the factors in two distinct analysis of deviance table:
- A within B1, A within B2, A within B3 and A within B4
- B within A1, B within A2, B within A3 and B within A4
Here is a code that illustrates
2009 Jan 12
1
Help with storage of each matrix generated in a loop
I need to store each matrix generated in a loop.
I've been working with the CUSUM algorithm and I've been trying to implement
it in R.
What I need to do with my dataset is to create 1000 randomized datasets and
cumulative sum them all and store all of those randomized CUSUMed datasets
for further analysis and creation of the simulation envelope in the CUSUM
chart. But I can't manage