Displaying 9 results from an estimated 9 matches for "jonas80".
2009 Sep 04
2
help with functions
Hi all,
I have got 2 function (see bellow) which are simplifications of what I need
to do. These functions are precisely the same, except for the last line.
My question is, why doesn't function testA work in the same way as function
testB.
Both functions produce two objects, "a" and "b" that must merged with rbind.
The difference is that in testA, I specify the name
2009 May 16
1
vector fragment
Dear R users:
I have got a simple question that has been bothering me for a while.
Given a certain character vector, I would like to get in a separate vector a
fragment of text, in this case the 3rd and 4th letters of each element.
So, if:
v<- c(“stratosphere”, “mesosphere”, “troposphere”)
I want to obtain a different vector like this:
c(“ra”, “so”, “op”)
Thanks in advance
2009 Oct 13
2
axis labels
Dear list,
why does the distance between the axis labels and the tick marks looks
different for x axis and y axis in the plot (see code below).
In fact, the x axis labels look furthest from the tickmarks than in the y
axis.
How can I make them look the same?
par(mfrow=c(1,1), cex.axis = 0.5, cex.lab = 0.5)
plot(1,1, axes = F)
axis(1)
axis(2)
Thanks in advance
Jonas
[[alternative HTML version
2011 Sep 12
1
Multilevel model in lme4 and nlme
Dear list,
I am trying to fit some mixed models using packages lme4 and nlme.
I did the model selection using lmer but I suspect that I may have some
autocorrelation going on in my data so I would like to have a look using the
handy correlation structures available in nlme.
The problem is that I cannot translate my lmer model to lme:
mod1<- lmer(y~x + (1|a:b) + (1|b:c), data=mydata)
2009 Sep 01
2
cbind objects using character vectors
Dear list,
I have a character vector such vec.names<- c("a", "b")
It happens that I have also two R objects called "a" and "b" that I would
like to merge. Is it possible to
do something like cbind(vec.names[1], vec.names[2]) ending up with the same
result as cbind(a,b)
Bellow is a reproducible example of what I need to to:
dat<-
2010 Oct 20
1
help identifying clusters
Dear list:
I have a dataset of geographical data that looks like this example data:
dat<- data.frame( lon = c(rnorm(1000, mean=-10), rnorm(1000, mean=10),
rnorm(1000, mean=5)),
lat = c(rnorm(1000, mean=40), rnorm(1000, mean=30), rnorm(1000, mean=0)))
plot(dat$lon, dat$lat)
My positions are clearly clustered (in this example there are 3 clusters).
Is there any R algorithm that
allows me to
2010 Oct 25
1
calculate area between intersecting polygons
Dear list:
I am trying to calculate the intersection area between two irregular
polygons (see example data below).
set.seed(1234)
theta <- seq(0, 2 * pi, length=(100))
poly1<- cbind(c(0 + 1 * cos(theta) + rnorm(100, sd=0.1)), c(0 + 2 *
sin(theta)))
poly2<- cbind(c(0 + 2 * cos(theta) ), c(-1 + 1.5 * sin(theta)+ rnorm(100,
sd=0.1)))
plot(x, y, type = "n", ,
2010 Mar 03
1
End of line marker?
Dear R users,
I am trying to read a huge file in R. For some reason, only a part of the
file is read. When I further investigated, I found that in one of my
non-numeric columns, there is one odd character responsible for this, which
I reproduce bellow:
In case you cannot see it, it looks like a right arrow, but it is not the
one you get from microsoft word in menu "insert symbol".
I
2008 Dec 10
2
missing argument
Dear list,
I have a question and I'm going to give an example of my problem
f<- function(d1, d2, d3)
{
d<- d1*d2/d3
return(d)
}
v1<- 1
v2<- 2
If I try
f(v1, v2, v3)
Error in f(v1, v2, v3) : object "v3" not found
I obviously got the above error message.
I would like to add something to my function to allow me to get a certain
value (say zero)
if one of the arguments is