Displaying 20 results from an estimated 3000 matches similar to: "Change pattern in histograms in ggplot2"
2008 Oct 16
5
2 Models: Same name, different namespace => Problems
Let''s start with an example:
---
class Comment < ActiveRecord::Base
end
# dummy (to invent a "table namespace")
class Review < ActiveRecord::Base
end
# ... dummy
# is "review_comments" in the database
class Review::Comment < ActiveRecord::Base
belongs_to :thing
end
class Review::Thing < ActiveRecord::Base
has_many :comments, :class_name =>
2008 Jun 20
5
About prototype.js and xml dom
Hello,
I''m looking for a cross-browsers library based on prototype.js that
wraps XML dom.
I tried to extend XML dom elements by using Object.extend and
Element.extend without success.
It works fine with firefox (Object.extend) but don''t work with IE
(msxml).
I suppose that IE objects are not ''prototype based'' objects.
Is there a way to go around this issue like
2012 Apr 12
3
[LLVMdev] Support for "foreign" Visual Studio 64 bits C++ exceptions?
Hi,
We are currently porting our application to Windows 64 bits (amd64), and we are getting regressions from 32 bits relatively to LLVM 3.0's ability to get traversed by "foreign" Visual Studio C++ exceptions. That is, there is a crash when C++ exceptions which are thrown from Visual Studio code, are unwinding through LLVM code before being eventually catch by other Visual Studio
2012 Jul 17
3
Finding the column with the maximum value by row
Hi,
Let's say I have the following data:
> a=matrix(c(1,2,4,4,2,1,1,2,4),nrow=3,byrow=T)
> a
[,1] [,2] [,3]
[1,] 1 2 4
[2,] 4 2 1
[3,] 1 2 4
What syntax should I use to get R to tell me the column that corresponds to
the maximum value for each row?
For my example, I would like to get a vector that says 3, 1, 3 because the
maximum value for row 1 is
2008 Jan 30
1
Can before_filter using Proc and specify block ?
Hi,
I see from this post
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/97e333daab05b725/8252c90cb9c36f6d?lnk=gst&q=passing+parameter+before_filter#8252c90cb9c36f6d
it can specify the Proc in the before_filter function, but when
specify when action apply this filter, it raise an syntax error, such
as rthe following code
before_filter {|controller|
2011 Mar 30
6
Quick recode of -999 to NA in R
Hi,
I am trying to write a loop to recode my data from -999 to NA in R. What's
the most efficient way to do this? Below is what I'm presently doing, which
is inefficient. Thanks,
Chris
dat0 <- read.table("time1.dat")
colnames(dat0) <- c("e1dq", "e1arcp", "e1dev", "s1prcp", "s1nrcp", "s1ints",
2012 Apr 09
3
For loops
Hi,
I am having trouble with syntax for a for loop. Here is what I am trying to
do.
class=c(rep(1,3),rep(2,3),rep(3,3))
out1=rnorm(length(class))
out2=rnorm(length(class))
out3=rnorm(length(class))
data=data.frame(class,out1,out2,out3)
dat.split=split(data,data$class)
for(i in 1:3){
sub[i]=dat.split[i]
}
However, the for loop doesn't work. I want to assign each split to a
different
2010 Jul 22
2
Multilevel survival model
* Please cc me if you reply as I am a digest subscriber *
Hi,
I am wondering how I can run a multilevel survival model in R? Below is
some of my data.
> head(bi0.test)
childid famid lifedxm sex age delta
1 22.02 22 CONTROL MALES 21.36893 0
2 13.02 13 MAJOR MALES 21.18001 0
3 64.02 64 CONTROL MALES 20.09377 0
4 5.02 5 CONTROL FEMALES
2009 Mar 12
3
Unable to run smoother in qplot() or ggplot() - complains about knots
I get the following error when I run qplot()
qplot(grade, read,data = hhm.long.m, geom = c("point", "smooth"))
Error in smooth.construct.cr.smooth.spec(object, data, knots) :
x has insufficient unique values to support 10 knots: reduce k.
I am not sure how to tackle this problem. When I take a subsample (<
1000) than I am able to run that function but with my sample
2010 Jul 23
1
Survival analysis MLE gives NA or enormous standard errors
Hi,
I am trying to fit the following model:
sr.reg.s4.nore <- survreg(Surv(age_sym4,sym4), as.factor(lifedxm),
data=bip.surv)
Where age_sym4 is the age that a subject develops clinical thought
problems; sym4 is whether they develop clinical thoughts problems (0 or
1); and lifedxm is mother's diagnosis: BIPOLAR, MAJOR DEPRESSION, or
CONTROL.
I am interested in whether or not
2011 Mar 29
4
Creating 3 vectors that sum to 1
I have 3 vectors: p1, p2, and p3. I would like each vector to be any
possible value between 0 and 1 and p1 + p2 + p3 = 1. I want to graph these
and I've thought about using scatterplot3d(). Here's what I have so far.
library(scatterplot3d)
p1 <- c(1,0,0,.5,.5,0,.5,.25,.25,.34,.33,.33,.8,.1,.1,.9,.05,.05)
p2 <- c(0,1,0,.5,0,.5,.25,.5,.25,.33,.34,.33,.1,.8,.1,.05,.9,.05)
p3 <-
2007 Nov 19
2
login help - grouping records
I have a long list of posts posted on different days and many posts
every day. I want them to arrange like following...
Date1
-----
post1
post2
Date2
-----
post3
post4
post5
How can I (say) group them to appear all posts of one date under their
related headng.
Because records have so many different days, it is confusing me.. I need
some generic solution.
Thanks in advance.
--
Posted via
2007 Aug 16
1
Nested REST resource routes without controller name
I am curious if the following URL pattern is appropriate to use with
REST and map.resources:
Let''s say I want to build a website with information about cars. I
decide that there will be a page to view/manage cars by model. The
route for this is easily created:
map.resources :cars
The URLs look great. But now I want to introduce the ability to
specify cars by year. I can do this by
2010 Nov 23
1
format y-axis values in ggplot
Hi,
I'd like to change scientific number formatting, 1,E+06, in y-axis values
to 1 000 000 (number with 1000 separator). How to do this in ggplot..? I
tried to use scale_discrete but couldn't get it to work. Below is a code I
have this far:
p<-ggplot(Data,aes(x=Date,y=PRINCIPAL))
p+geom_point()
Thanks for any help!
-Jack
[[alternative HTML version deleted]]
2011 Sep 08
1
problem with math expressions in grid graphics when using line breaks (\n)
I want to plot a multiline annotation including a mathematical expression using grid graphics (grid.text).
This works fine for a single line, but the math expression is misplaced when I insert a line break ("\n" escape sequence):
grid.text(expression(paste("Some words here\n more ", sigma)))
Does someone have an idea how to fix that?
TIA!
Mark
2007 Jun 25
7
problem after update 3.0.22 -> 3.0.24
Hello everybody,
we were running into trouble after upgrading our samba PDC to a new
hardware (and a new debian release).
Before the upgrade we used 3.0.22 on a debian sarge machine without
problems.
Moving the installation to a new machine with debian etch (amd64, samba
3.0.24-6etch4) worked good at the first look.
A closer look shows the following problems:
- a domain member server (samba
2010 May 13
1
Questions about ggplot2
Hi I have two questions about using ggplot2.
First, I have multiple columns of data that I would like to combine into
one histogram where each column of data would correspond to one bar in
the histogram. Each column has 0 or 1s and I want my bars in the
histogram to correspond to the sum of the 1s in each column. Does that
make sense?
Second, is there a way to completely turn off the legend?
2009 Jun 28
1
ggplot2 x axis question
Hi,
I have 45 models that I have named: 1, 2, 3, ... , 45 and I am trying to
plot them in order of ascending BIC values. I am however unclear as to
how I can get the models to line up on the x-axis by BIC and not by
numeric order. For example, if model 5 has a lower BIC than 1, I want it
to be the first point on the left hand side of the curve. This seems to
work in plot:
plot(1:45,
2009 Jun 28
1
ggplot2 x axis question
Hi,
I have 45 models that I have named: 1, 2, 3, ... , 45 and I am trying to
plot them in order of ascending BIC values. I am however unclear as to
how I can get the models to line up on the x-axis by BIC and not by
numeric order. For example, if model 5 has a lower BIC than 1, I want it
to be the first point on the left hand side of the curve. This seems to
work in plot:
plot(1:45,
2011 Apr 06
3
Getting number of students with zeroes in long format
Hi,
I have longitudinal school suspension data on students. I would like to
figure out how many students (id_r) have no suspensions (sus), i.e. have a
code of '0'. My data is in long format and the first 20 records look like
the following:
> suslm[1:20,c(1,7)]
id_r sus
11 0
15 10
16 0
18 0
19 0
19 0
20 0
21 0
21 0
22 0
24 0
24