Displaying 20 results from an estimated 11000 matches similar to: "Find the average line from several lines"
2012 Dec 13
2
replace parenthetical phrases in a string
R-helpers,
I have a vector of character strings in which I would like to replace each
parenthetical phrase with a single space, " ". For example if I start with
x, I would like to end up with y.
x <- c("My toast=bog(keep=3 no=4) and eggs(er34)omit=32",
"dogs have ears",
"cats have tails (and ears, too!)")
y <- c("My toast=bog and eggs
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
2008 Dec 18
1
inserting zero instances with zeroes in a matrix
Hi all,
Suppose I had the below example where a survey was carried out recording the number of each type of pet in each house
count<-c(2,1,2,1,2,3,4)
house<-c("house1","house1","house2","house3","house4","house4","house4")
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,
2005 Dec 23
6
Stories with many tags, tags with many stories, has_and_belongs_to_many howto?
Hi,
I began experimenting with habtm relationships, and so I created a
stories table, a tags table, and a stories_tags table referencing the
former 2.
When I create a "story", I want to add several tags to it. Then, the
model should create those tags and link them to the respective stories,
and for the tags that already exists, just link them to the story.
I tried something like
2012 Jan 27
1
Horizontal stacked 100% bars with ggplot2
Hello, R friends,
I'm trying to crack this nut:
Example Data.
pet gender
dog male
dog female
dog male
cat female
cat female
cat male
Plot Task.
Horizontal 100% bars where
y axis shows gender factor (male vs. female)
and x axis shows percentage of kind of pets (dog vs. cat)
so that % dogs + % cats are stacked in 1 bar and sum up to 100% (for each gender group 1
2023 Feb 22
1
Change 48 khz sample rate limit
You asked in the Vorbis list, but your text only mentions OGG. The
codec commonly used in OGG containers that is limited to 48 khz is
Opus. Maybe you are trying to use the wrong codec (i.e. Opus instead
of Vorbis)?
Using a 44.1 khz wav file, I was able to encode a 192 khz ogg-vorbis
file with the following command:
$ oggenc --resample 192000 input.wav
Of course, if your original material is
2011 Feb 02
3
Average of several line plots
Hi,
I have several data sets which are all approximately within the same values
as each other (both X and Y) and all of these data sets more or less overlap
each other when plotted on the same graph. However, although each data set
varies between approximately the same range, there are vastly different
numbers of data points within each data set (due to the nature of how these
values had to be
2009 Feb 10
6
OT: A test with dependent samples.
I am appealing to the general collective wisdom of this
list in respect of a statistics (rather than R) question. This question
comes to me from a friend who is a veterinary oncologist. In a study
that
she is writing up there were 73 cats who were treated with a drug called
piroxicam. None of the cats were observed to be subject to vomiting
prior
to treatment; 12 of the cats were subject to
2003 Dec 30
3
SIP phone as intercom
(new asterisk user - currently setting up Polycom IP600 phones)
Does anyone know if it's possible to make a sip phone instantly pick up
on speakerphone when a particular call comes in? Eg so that you can
quickly bother someone across the office without making them reach for
their phone?
2010 Jan 10
0
commandArgs return value
Hello,
I plan to use a script with R CMD BATCH on different platforms Linux,
Windows and Mac OSX. I use the commandArgs(trailing = FALSE) function
to retrieve the name of the script and the arguments (example below
with output.) The online docs for "Introduction to R" (sections B.1
Invoking R from the command line and B.4 Scripting with R) and
help("commandArgs")
2007 Jun 07
1
Averaging across rows & columns
I use Windows, R version 2.4.1.
I have a dataset in which columns 1-3 are replicates, 4-6, are replicates,
etc. I need to calculate an average for every set of replicates (columns
1-3, 4-6, 7-9, etc.) AND each set of replicates should be averaged every 14
rows (for more detail, to measure fruit color using a spectrometer, I
recorded three readings per fruit -replicates- that I need to average to
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and
often do: rake load_fixtures...
... in order to populate my development database with fun data.
Now, with any HABTM relationship, there are failures, as there is no way to
say "which" fixtures to load first.
Within an actual functional or unit test case, you could simply load them in
the proper order, but
2006 Feb 19
0
creating a model that has other models as elements
Say I have the following three tables:
dogs
-------
id (PK)
name
cats
------
id (PK)
name
recipies
-----------
id (PK)
recipie_text
I''ve made a model for each of them: Dog, Cat and Recipie.
Now I want to create a model, Cookoff, that will contain arrays of
Dog, Cat and Recipie objects. There is no associated database table
for Cookoff because it''s merely a container for a
2005 Aug 15
3
How to repeat code snippet for several variables in a data frame?
Dear all,
I have a data frame containing the results of an experiment. Like this:
a<-seq(1,4,by=1)
b<-seq(1,2,by=1)
test<-expand.grid(b,a,a)
colnames(test)<-c("replicates","bins", "groups")
test$abc <- rnorm(32)
test$def <- rnorm(32)
test$ghi <- rnorm(32)
test
The following code snippet aggregates the data for one variable and then
draws a
2013 Feb 28
3
Hidden information in an object
Hello, The dataset "cats" contain information about the heart weight ("Hwt"), body weight ("Bwt") and gender ("Sex") of a group of 144 cats. I write the following piece of code: library(MASS)attach(cats)ratio <- Hwt/Bwtmale <- ratio[Sex == "M"]female <- ratio[Sex == "F"] My question is, when I look at the object
2009 Feb 04
2
Sweave and \Sexpr{}
Hi:
I am trying to create a dynamic latex table using \Sexpr{} but it's not evaluating it. I also tried the example below without Sweave and also fails. I have also copied the Sweave.sty to my working directory but nothing seems to work. Do I need to have certain package in order to run \Sexpr{}?
\documentclass[a4paper]{article}
\usepackage{C:/R/R-2.8.1/share/texmf/Sweave}
\begin{document}
2005 Aug 16
3
Stacked Area chart
I wish to do a stacked area chart to show how relative proportions of species within a stand have changed over time.
I know this is simple, but can someone point me to the right function (if it exists). I have not had any luck finding it in the R-help, but maybe I am searching using the wrong keywords.
Thanks,
Mike
Mike Saunders
Research Assistant
Forest Ecosystem Research Program
Department
2012 Apr 03
3
Sweave xtable
Hola
Tengo un problema con Sweave y xtable, concretamente quiero cambiar el color según un criterio, creo que es más fácil explicar con los siguientes ejemplos, uno puede correr directamente porque es R, al siguiente código hay que guardarlo como Rnw, y luego puede ser corrido en R, donde seguramente al correr este se darán cuenta de mis dos problemas porque saltan al abrir el pdf que se obtiene
2006 Jul 04
1
Has_many :through with checkboxes?
Just when I started getting the hang of has_and_belongs_to_many
relationships, I realize that I should probably convert several of my
app''s joins to has_many :through type relationships.
One example, pairing users with categories via subscriptions, where
each user can be the "owner" of a category, has given me particular
trouble when I try to update a user''s