Displaying 20 results from an estimated 10000 matches similar to: "Question on Counting Factors"
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
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
2008 Jul 31
4
Identifying common prefixes from a vector of words, and delete those prefixes
For example, c("dog.is.an.animal", "cat.is.an.animal", "rat.is.an.animal"). How can I identify the common prefix is ".is.an.animal" and delete it to give c("dog", "cat", "rat") ?
Thanks
_________________________________________________________________
[[alternative HTML version deleted]]
2012 May 03
3
inheritance with rails.
Hello.
I''ve read about examples on inheritance with rails.
Here is an example:
http://juixe.com/techknow/index.php/2006/06/03/rails-single-table-inheritance/
The way is to add a type field in the table.
So if I have an Animal class with an attribute name, I can inherit
from this class like:
Dog < Animal, Cat < Animal, and so on.
With the type field in the table I can do Dog.all,
2011 Jan 01
3
Plot symbols: How to plot (and save) a graphic symbols originating from a table
Dear all,
Please, I have a doubt regarding symbol plotting
with data originating from a table.
Please, see below:
I have a tab delimited file called table1.txt with 4 columns:
ypos animal var1 var2
5 cat gina <= lady gina \u2264 lady
7 dog bill >= tony bill \u2265 tony
9 fish dude <= bro dude \u2264 bro
#I then load in the data to R:
table1<-read.table("table1.txt",
2010 Dec 13
3
check for item in vector
Dear R users,
Suppose I have an vector like this:
animal <- c("Tiger","Panda")
I would like to know is there any function that check for the
existence of certain item in a vector.
e.g.
> func("Tiger",animal) # check for the existence of "Tiger"
TRUE
> func("Acacia",animal) #Acacia is not an item of the animal vector
FALSE
I know
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
2012 Jun 28
3
loop through and modify multiple data frames
Hi
Newbie question:
I have a set of data frames that I want to do the same calculations on each.
I've found out that I can put them in a list and loop through the list
to do the calculation, but not put the results back into each
data.frame..
For example three data frames cats, dogs, birds
where >cats
name eats_kg
1 bob 3
2 garfield 4
3 chuck 6
and dogs and birds are similar but not
2017 Apr 20
4
Relocation design of different architecture
Thanks for the reply. I was just asking about in general whatever header
files are there in Targets/ for different architectures are not including
any function except this processRelocationRef() to be used in
RuntimeDyldELF.cpp or RuntimeDyldCOFF.cpp or RuntimeDyldMachO.cpp and i
think these files are the ones which are actually doing the relocation and
linking work. So what purpose do these
2005 Nov 26
6
Fuzzy searching
Hi, everyone,
Just wondering if someone had come up with a good way to do fuzzy
searches if you use MySQL as your database (we tried switching to
PostgreSQL, but that ended up adding even more problems). Ferret sounds
great, but reading through the discussion it looks like we need to solve
the problem of write conflicts. I just wrote a post in ruby-talk about
using KirbyBase maybe to solve
2017 Apr 21
2
Relocation design of different architecture
Thanks for reply, it was really helpful. Can u just be more specific and
tell about processRelocationRef() and resolveRelocation() in
Targets/RuntimeDyld(objectfile format)(arch).h and also in
RuntimeDyldELF.cpp and how the same function is implemented in different
ways in both the files ?
Thanks,
Siddharth
On Thu, Apr 20, 2017 at 8:16 PM, mats petersson <mats at planetcatfish.com>
wrote:
2010 Apr 18
1
Comparing data frames
Dear very helpful friends,
It is Sunday, there is no air traffic in Europe, what better to do
than try and learn me some more R.
I have the following example:
owner <- c(1:4)
animal <- c("cat", "dog", "cat", "dog")
char.1 <- c("fluffy", "playful", "mean", "stupid")
food <- c("cat food",
2017 Apr 21
2
Relocation design of different architecture
Thanks. I am just trying to find a relocation and linking design for
Hexagon architecture, whether to follow the MIPS style of relocation or
other architecture style of relocation. Thats my question . Thats why i was
asking about the functions and their differences Please guide.
Thanks,
Siddharth
On Fri, Apr 21, 2017 at 8:37 PM, mats petersson <mats at planetcatfish.com>
wrote:
> If
2010 Mar 31
2
interpretation of p values for highly correlated logistic analysis
Dear list,
I want to perform a logistic regression analysis with multiple
categorical predictors (i.e., a logit) on some data where there is a
very definite relationship between one predicator and the
response/independent variable. The problem I have is that in such a
case the p value goes very high (while I as a naive newbie would
expect it to crash towards 0).
I'll illustrate my problem
2006 Mar 02
1
ActiveRecord in modules & associations
I''d like to organise my active records into modules but can''t get the
associations to work. The doc says that associations within the same
module should work. I''ve tried using the class_name option too but still
doesn''t work.
Can anyone help?
For example
module Mod1
class Animal < ActiveRecord::Base
has_many :dogs, :class_name =>
2010 Jul 30
3
simple table/matrix problem
Hi
Given three vectors
x <- c(fish=3, dogs=5, bats=2)
y <- c(dogs=1, hogs=3)
z <- c(bats=3, dogs=5)
How do I create a multi-way table like the following?
> out
x y z
bats 2 0 3
dogs 5 1 5
fish 3 0 0
hogs 0 3 0
('out' is a matrix).
See how the first line shows 'x' has 2 bats, 'y' has zero bats, and 'z'
has 3 bats
and so on for each
2010 Jun 08
2
setting up zoo objects from a data frame
Dear R People:
I have the following data frame:
> str(dog.df)
'data.frame': 7 obs. of 2 variables:
$ V1: Factor w/ 3 levels "1/1/2000","1/2/2000",..: 1 1 1 2 2 3 3
$ V2: Factor w/ 3 levels "cat","dog","tree": 2 1 3 1 3 2 3
> dog.df
V1 V2
1 1/1/2000 dog
2 1/1/2000 cat
3 1/1/2000 tree
4 1/2/2000 cat
5 1/2/2000 tree
6
2004 Nov 04
4
highly biased PCA data?
Hello, supposing that I have two or three clear categories for my data,
lets say pet preferece across fish, cat, dog. Lets say most people rate
their preference as being mostly one of the categories.
I want to do pca on the data to see three 'groups' of people, one group
for fish, one for cat and one for dog. I would like to see the odd person
who likes both or all three in the
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) {
2004 Jul 12
5
help with paste
Hello All:
Suppose the following little data frame:
> x <- data.frame(dog = c(3,4,6,2,8), cat = c(8,2,3,6,1))
>
> x$cat
[1] 8 2 3 6 1
>
How can I get the paste() function to do the same thing. The command
below is obviously wrong
> paste(x, cat, sep = "$")
>
Thanks,
ANDREW