search for: elai

Displaying 20 results from an estimated 25 matches for "elai".

Did you mean: ela
2005 Mar 04
0
Multilevel modeling of animal behavior
...al with inter-level interactions (Hox, 1995) might resolve the problem, allowing analysis on individuals. But am unsure of my approach. I will be grateful if anyone is interested in reading the following problem in detail and commenting on any aspect of my proposed solution. Thank you in advance, Elai. +++++++++ + General: + +++++++++ I am trying to analyze the impact of temperature, wind, and solar radiation on cattle behavior in winter (e.g. exposure to the sun, use of windbreaks). Individual cow's behavior in the field is partly influenced by group behavior and it's nearest n...
2012 Feb 07
6
Setting up infile for R CMD BATCH
Suppose I create an R program called myTest.R with only one line like the following: type <- as.integer(readline("input type (1: type1; 2: type2)? ")) Then I'd like to run myTest.R in batch mode by constructing an input file called answers.R with the following: source("myTest.R") 1 When I ran the following at the terminal: R CMD BATCH answer.R output.Rout it failed
2012 Feb 23
2
help with winbugs glm
Hi, I am running a model with count data and one categorical predictor (simple model for me to understand it fully), I did in R a glm like this: glm(Recruitment~Depth, family=poisson). I get the coefficientes and confidence intervals and all is ok. But then I want to do the same model with Bayesian stats, here is my code: model { for (i in 1:232) { Recruitment[i]~dpois(lambda[i])
2012 Feb 23
5
cor() on sets of vectors
suppose I have two sets of vectors: x1,x2,...,xN and y1,y2,...,yN. I want N correlations: cor(x1,y1), cor(x2,y2), ..., cor(xN,yN). my sets of vectors are arranged as data frames x & y (vector=column): x <- data.frame(a=rnorm(10),b=rnorm(10),c=rnorm(10)) y <- data.frame(d=rnorm(10),e=rnorm(10),f=rnorm(10)) cor(x,y) returns a _matrix_ of all pairwise correlations: cor(x,y)
2012 Feb 18
3
foreach %do% and %dopar%
Hi everyone, I'm working on a script trying to use foreach %dopar% but without success, so I manage to run the code with foreach %do% and looks like this: The code is part of a MCMC model for projects valuation, returning the most important results (VPN, TIR, EVA, etc.) of the simulation. foreach (simx = NsimT, .combine=cbind, .inorder=FALSE, .verbose=TRUE) %do% { MCPVMPA = MCVAMPA[simx]
2012 Feb 09
2
Lattice 3d coordinate transformation
...t. ?utilities.3d says there may be some bugs, and I think ltransform3dto3d() is not precise (where did I hear that?), but is this really the source of my problem? Is there a (simple?) workaround, maybe using 3d.wire but projecting it to XY? How? Please, any insight may be useful. Thanks in advance, Elai. A working example: ## data "d" and predicted "surf": set.seed(1113) d <- data.frame(x=runif(30),y=runif(30),g=gl(2,15)) d$z <- with(d,rnorm(30,3*asin(x^2)-5*y^as.integer(g),.1)) d$z <- d$z+min(d$z)^2 surf <- by(d,d$g,function(D){ fit <- lm(z~poly(x,2)*poly(...
2012 Feb 24
1
data frame manipulation with conditions
Dear list, n00b question, but still can't find any easy answer. Here is a df: > df<-data.frame(cbind(x=c("AA","BB","CC","AA"),y=1:4)) > df x y 1 AA 1 2 BB 2 3 CC 3 4 AA 4 I want to modify this df this way : if df$x=="AA" then df$y=df$y*10 if df$x=="BB" then df$y=df$y*25 and so on with other conditions. TY for any
2012 Mar 01
1
barplots of several variables with different number of categories
If I have two factors, v1 and v2 and I want to have a stacked bar graph of the two variables side by side I could do barplot(cbind(table(v1),table(v2))) if v1 and v2 have the same number of categories. If they don't have the same number of categories this won't work. I'm sure there's a simple solution? Thanks, Jon -- View this message in context:
2012 Feb 24
1
tcl tk command function with arguments ??
Hello, I am using R 2.11.1 under Windows XP. I would like to know if its possible to use a function with arguments as a command in tcl tk. For example require(tcltk) PressedOK <- function() { tkmessageBox(message="You pressed OK!") } tt <- tktoplevel() OK.but <- tkbutton(tt,text="OK",command=PressedOK) tkgrid(OK.but) tkfocus(tt) the function PressedOK has no
2012 Feb 22
1
Lattice and horizontally stacked density plots
Hello, I am try to make a density plot where plots are stacked like the one found here: http://dsarkar.fhcrc.org/lattice/book/images/Figure_14_03_stdBW.png I am facing problems, however. Using the code example below, I'd like to generate a separate panel for each val of id2. Within each panel, I'd like to have individual histograms each on separate lines based on the value of id1. ?Note
2012 Mar 25
2
Updating a Markov Chain
Hello, my question is if anyone has any good ideas how to create a Markov Chain from ordered data. So, I have some sort of time series, and if value1 happens as time1 and value2 happens at time2 I record this as an update to the probability transition matrix. The problem is that I cannot predefine the size of the matrix (as I don't know how many states(values) I will have in the end) and
2012 Feb 21
1
tapply for enormous (>2^31 row) matrices
Hi all, SETUP: I have pairwise data on 22 chromosomes. Data matrix X for a given chromosome looks like this: 1 13 58 1.12 6 142 56 1.11 18 307 64 3.13 22 320 58 0.72 Where column 1 is person ID 1, column 2 is person ID 2, column 3 can be ignored, and column 4 is how much chromosomal sharing those two individuals have in some small portion of the chromosome. There are 9000 individual people, and
2012 Feb 25
2
Finding name of variable supplied as function argument
Greetings All. I want to do the following simple thing. I have defined a function med3x3() such that, given vectors X,Y, med3x3(X,Y) returns a 3x3 table where: Row 1: X > median(X) Row 2: X = median(X) Row 3: X < median(X) Col 1: Y < median(Y) Col 2: Y = median(Y) Col 3: Y > median(Y) (with intersections of these conditions for the individual cells). I can easily define fixed
2012 Mar 28
1
xyplot lattice fine control of axes limits and thick marks (with log scale)
After a long and winding road (sorry but I'm a novice) I get to a final result which is quite close to what I need; nevertheless I would like to tweak a little further the xyplot so that I can get ***for each single panel defined by variable z*** a finer control over: -the x and y the limits: I would like to be the same for both axes; -the number of thick marks: again I would like to be same
2012 Feb 28
2
ts.plot and x axes customization
Dear List, I would be pleased if someone can help me with the following issue: I'm about to plot two time series in one plot via ts.plot which looks like: ts.plot(series1, series2, main=main, xlab=xlab, ylab=ylab, col=c("green", "red", "blue"), lwd=2) The problem is, that R automatically sets the x axes labels in 5-year-intervalls. Every
2012 Feb 06
1
Multi-page PDF using dev.copy2pdf(filename, onefile=TRUE)?
Hi all. I want to generate a sequence of n plots and save them into a single PDF file, one plot per page. From the R docs and other sources I gather the basic way to do this is save plot 1 into a file then append the 2:n plots to the same file.  This code shows my basic approach, but for some reason only the last plot is saved into the pdf. I've tried different variations (e.g. using onefile
2012 Apr 07
6
Drawing a line in xyplot
i am trying to replicate the following graph using xyplot : attach(x) plot ( jitter(type), mortality, pch=16, xlim = c(0.25, 3.75)) lines ( c(1-0.375,1.375) , c ( median(mortality[type==1]), median(mortality[type==1])), lwd=5,col=2) lines ( c(2-0.375,2.375) , c ( median(mortality[type==2]), median(mortality[type==2])), lwd=5,col=2) lines ( c(3-0.375,3.375) , c ( median(mortality[type==3]),
2012 Feb 09
1
passing an extra argument to an S3 generic
I'm trying to write some functions extending influence measures to multivariate linear models and also allow subsets of size m>=1 to be considered for deletion diagnostics. I'd like these to work roughly parallel to those functions for the univariate lm where only single case deletion (m=1) diagnostics are considered. Corresponding to stats::hatvalues.lm, the S3 method for class
2012 Feb 20
1
Time taken to process a file after a socket connection was made
Hello R people, I have created a '.csv' file of 100 rows by 20 columns whose each cell contains a random numbers between 0 & 1, thru a Java program. Once that is created a signal (just a letter) is send to the port of a socket connection at "localhost", which was earlier started by an "R" session. Now the "R" reads the '.csv' file into a data
2012 Feb 19
2
barplot with more than 1 variable
Dear R listers, I am trying to produce a simple (for a stata user) barplot with 4 countries on the x axis, each country observed in 2 subsequent years and 3 variables. Basically, I should have three bars for each year for each country. I am attaching the chart I made in Stata, but I am not sure you'll manage to see it! I did the following: #here I create the data-set TUSE2. The vectors mw, st