Displaying 20 results from an estimated 3000 matches similar to: "Population model question"
2011 Jul 17
3
gsub() with unicode and escape character
Dear helpers,
I'm trying to replace a character with a unicode code inside a data
frame using gsub(), but unsuccessfully.
> data.frame(animals=c("dog","wolf","cat"))->my.data
> gsub("o","\u0254",my.data$animals)->my.data$animals
> my.data$animals
[1] "d??g" "w??lf" "cat"
It's not that a data
2002 Apr 10
3
Strange assignment bug (PR#1450)
Dear bugs @r;
The following reproduces erroneous results on my system using R-gui:
platform i386-pc-mingw32
arch x86
os Win32
system x86, Win32
status
major 1
minor 4.1
year 2002
month 01
day 30
language R
#####################################################
inter.gp.effect <- 0.1
animals <- data.frame(pos = 0:2)
SI.model <- function(Animal.group) {
2012 Apr 11
3
Question on Counting Factors
Hi,
I hope this is not too trivial, but I've had this recurring problem
and I think there is super easy solution, just not sure what it is.
Please see short example below. ?I would like to get the frequency
(counts) of all the variables in a single column (that is easy), but I
would also like to return the value 0 for the absence of variables
defined in another column.
For example:
animals
2009 Jan 30
2
Subsetting without partial matches
I have a list of observations of individuals. I would like to make a
list of individuals, with a data frame of observations for each individual.
The following code usually works, but not always
----------------------------------------------------------------------
# Make a list of empty data frames
animals = list()
indivs = levels(Z$individual_id)
donotprint <- sapply(indivs, function(i){
2010 Mar 18
2
Pedigree / Identifying Immediate Family of Index Animal
I have a data frame containing the Id, Mother, Father and Sex from about
10,000 animals in our colony. I am interested in graphing simple family
trees for a given subject or small number of subjects. The basic idea is:
start with data frame from entire colony and list of index animals. I need
to identify all immediate relatives of these index animals and plot the
pedigree for them. We're
2007 Mar 27
1
REST rspec_generator
Is there some reason that the rspec resource generator produces code
like this:
context "Routes for the AnimalsController should map" do
controller_name :animals
specify "{ :controller => ''animals'', :action => ''index'' } to /
animals" do
route_for(:controller => "animals", :action =>
2012 May 15
9
help
1. Emma is performing an experiment that requires individual handling of some animals. The sizes of the animals are lognormally distributed: The natural logarithms of their sizes has a normal distribution with mean 3 and standard deviation 0.4. The time (in minutes) it takes to handle each animal is given by
10 + s · 1.5 + eε for animals with s ≤ 20 20 + s · 0.8 + eε for animals with s > 20
2006 Apr 22
4
Slice and dice plugin
I''ve been playing around with some easier ways of specifying
conditions in active record, and have come up with a little plugin
that some may find useful. Currently active record finder and
calculations methods can take a :conditions option with a string or
array listing some sql conditions, eg:
Animals.find :first, :conditions => "name = ''Tiger''"
My
2005 Aug 10
2
Treatment-response analysis along time
Dear R people,
I wonder if you could give me a hand with some of my data. I have a very
typical analysis in biology, however it is difficult for me to find the
right way to analyse. I had a group of animals, I gave them a treatment, and
I measure a variable along time -one??s per day- along 5 days,for
example(fake data):
Animals Time1 Time2 Time3 Time4
1 1 5 3
2011 Mar 31
3
Create Variable names dynamically
Hi,
I want to create variable names from within my code, but can't find any documentation for this.
An example is probably the best way to illustrate. I am reading data in from a file, doing a bunch of stuff, and want to generate variables with my output. (I could make a "list of lists" and name all the elements, but I really want separate variables.)
#################
#This is
2006 Aug 03
2
How to access a column by its label?
Hi all,
Is there any way to access a column of a data frame by its label (title)
rather than its column index? For example, I'd like to be able to select
animals[,"weight"] rather than animals[,3], if the third column of the
"animals" data frame has the label "weight".
Thank you!
[[alternative HTML version deleted]]
2013 Feb 27
1
metafor - interpretion of QM in mixed-effects model with factor moderator
Hi,
I'm using metafor to perform a mixed-effects meta-analysis. I'd like to
test whether the effect is different for animals and plants/whether "group"
(animal/plant) influences the effect size, but am having trouble
interpreting the results I get. I've read previous posts about QM in
metafor, but I'm still a bit confused. I've dummy-coded the factors:
2010 Jun 07
1
Help with seting up comparison
Hi,
I tried on this, but couldn't figure it out:
Suppose I have a dataframe as follows:
dat <- data.frame(Day=rep(rep(c(1,2), each=4),2), Animal = rep(c(1,2),
each=8), Count=c(rnorm(8, 100), rnorm(8,90)))
2 animals are being examined on 2 different days. Count is the result.
Now I need to point out whether or not there is a difference between the
days.
I did this by an ANOVA test, while
2006 Oct 19
2
Getting group size in a data frame
Hi all,
I have a data frame with some measured values of some animals. Sometimes the
measurement failed, resulting in a NA for a measurement and sometimes the
animal died, resulting in NA for all measurements.
I have several groups of animals. How do I find the size of each group with
only alive animals? And how do I find the size of the groups for each
measurement?
An example:
l1 <-
2009 Oct 19
3
routing namespaced controllers
Hi,
I have one controller in the /app/controllers/animals_controller.rb
directory, and another in
/app/controllers/production/services_controller.rb. The thing is that
one Animal has many Services, and i''d like to access to them using
something like:
http://localhost:3000/animals/1/production/services/1
or at least with:
http://localhost:3000/animals/1/services/1
I tried the last one
2009 Mar 21
2
limiting simulated animal movement
Hi,
I am trying to simulate animal movement in a gridded landscape made up of
cells. At each time step (iteration), the animal moves from one cell to
another in a random fashion.
This is how I am simulating movement, where a and b are the x,y co-ordinates
of the animal at the previous time step:
for (i in 1:no.of.steps){
direction <- sample(1:8, 1)
if(direction == 1){
a <- a
b <- b -
2005 Jan 27
2
cluster, mona error
Hi
I have a problem using the package cluster on my binary data. I want to
try mona at first. But i get the an error.
hc<-read.table("all.txt", header=TRUE, sep="\t", row.names=1)
srt(hc)
`data.frame': 51 obs. of 59 variables:
$ G1p : int 2 1 1 1 1 1 1 1 1 1 ...
$ G1q : int 1 1 1 1 1 1 1 1 1 1 ...
$ G2p : int 1 1 1 1 1 1 1 1 1 1 ...
$ G2q : int 1 1 1 1 1 1
2006 Jan 01
3
Single Table inheitance doesn''t show subclasses ?
Hi, I am a Rails noob.
Suppose you have:
---
class Animal < ActiveRecord::Base
end
class Mammal < Animal
end
class Cow < Mammal
end
---
I provide Animal,Mammal and Cow controllers with the scaffolding, just
to test and to fill up the Animal table. I can see the "type" column
getting it''s value set with the class name.
So far, soo good.
Now, since listing Animals
2013 Apr 02
1
gdata selectively not working
I can use gdata to successfully read in the example Excel file, but not any
other excel files. Why might this be the case? It seems that the problem
has something to do with opening the database but no indication as to what
the problem is. So i'm at a loss of how to fix it.
> library(gdata)
gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.
gdata: read.xls support
2011 Jun 07
4
Sorting DataFrames
I am a new user, and i am trying to sort out a data frame.
I have for example bins of data. Within each bin i have multiple counts of animals and the depths at which these count were taken. How would I summarise this to being only the maximum count per bin alongisde the corresponding height (but not the maximum depth - i want the depth at which the maximum number of animals occurs).
Thank