Displaying 20 results from an estimated 2000 matches similar to: "Plotting just a portion of a smoother graph in ggplot2"
2013 Feb 01
2
Change default order of colors & line types
Dear R users,
I'd like to change the default order of colors & line types.
Especially I am using ggplot2 and using color Set1.
In Set1, the default color order is red, blue, green, violet,.. ect.
However, I want to put red in fourth (not first).
Likewise, I want to change the order of default linetype. I want to
put "solid" line in fourth.
How can I do thses?
R code to draw the
2010 Jun 24
1
Displaying additional values on the Y-axis ggplot2
Hi,
I am running the following code:
mfg0 <- ggplot(aes(x=Grade,y=Math,colour=RiskStatic45678),data=math.f)
mfg1 <- mfg0 + geom_smooth(method="lm", formula=y ~ ns(x,2),size=1) +
geom_smooth(aes(y=nalt.math,color="NALT"),size=1,data=nalt) +
scale_colour_brewer("Risk Status", pal="Set1") + coord_cartesian(ylim =
c(175, 245))
mfg1
And when I specify
2008 Mar 06
2
Help with parsing a data file
Hi All,
I need to parse data from a file, example shown below. The first two lines
can be skipped, the third line contains the column names. The next 13 lines
can be skipped. The next line "1991" is a year value, with the following 13
values data for that year. The file then repeats this format with (year, 13
lines of data for that year). I would ideally like to end up with an
2006 Mar 11
1
Non-linear Regression : Error in eval(expr, envir, enclos)
Hi..
i have an expression of the form:
model1<-nls(y~beta1*(x1+(k1*x2)+(k1*k1*x3)+(k2*x4)+(k2*k1*x5)+(k2*k2*x6)+(k3*x7)+(k3*k4*x8)+(k3*k2*x9)+(k3*k3*x10)+ (k4*x11)+(k4*k1*x12)+(k4*k2*x13)+(k4*k3*x14)+(k4*k4*x15)+(k5*x16)+(k5*k1*x17)+(k5*k2*x18)+(k5*k3*x19)+
2012 Jan 29
1
ColorBrewer question
Hello, R friends,
I'm trying to change colors of my horizontal bars so that they show a sequence.
I chose the ColorBrewer palette "Blues". However the resulting plot doesn't show any changes to the default.
I tried several places of "+ scale_colour_brewer(type="seq", pal = "Blues")" with no effect.
This is my code:
p <- ggplot(data, aes(x =
2004 Nov 10
2
cubic spline/smoother with nlme
Greetings, I would like to use a cubic spline
or smoother to model the fixed effects within
nlme. So far the only smoother I have been able
to get to run successfully in nlme is smooth().
I tried smooth.spline:
fixed=list(lKa~1,lCL~smooth.spline(BSA, df=3))
the error I got was the following.
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, : invalid
2008 Aug 05
2
95% CI bands on a Lowess smoother
Hi there,
I'm plotting some glass RI values just by plotting
plot(x)
then I put on my lowess smoother
lines(lowess(x))
now I want to put on some 95% Confidence Interval bands of the lowess
smoother, but don't know how??
Thanks
--
Gareth Campbell
PhD Candidate
The University of Auckland
P +649 815 3670
M +6421 256 3511
E gareth.campbell@esr.cri.nz
gcam032@gmail.com
[[alternative
2006 Jun 24
3
getting the smoother matrix from smooth.spline
Can anyone tell me the trick for obtaining the smoother matrix from smooth.spline when there are non-unique values for x. I have the following code but, of course, it only works when all values of x are unique.
## get the smoother matrix (x having unique values
smooth.matrix = function(x, df){
n = length(x);
A = matrix(0, n, n);
for(i in 1:n){
y = rep(0, n); y[i]=1;
yi =
2009 Oct 14
1
pairs
Dear all,
I have two sets of data (say set1 and set2) as follow:
set1
x1
x2
x3
0.30
0.43
3.88
0.38
0.59
3.53
0.30
0.42
2.12
0.33
0.53
2.12
0.30
0.47
3.76
set2
y1
y2
y3
0.32
0.47
5.18
0.23
0.26
1.06
0.42
0.65
3.88
0.28
0.38
3.76
0.35
0.47
1.41
The "pairs" function (such as pairs(~x1+x2+x3 data=set1, main="Simple Scatterplot Matrix") ) is
2011 Mar 08
3
allocating factor levels
Dear R users,
I am working on allocating the rows within a dataframe into some
factor levels.Consider the following dataframe:
Start.action Start.time
1 Start.setting 2010-12-30 17:58:00
2 Start.setting 2010-12-30 18:40:00
3 Start.setting 2010-12-31 22:39:00
4 Start.setting 2010-12-31 23:24:00
5
2009 Dec 11
4
extracting vectors from lists of lists
Good evening
I often have as output from simulations a list of various values, vectors
and matrices.
Supposing that I then run said simulation several times, I often want to
extract a particular result from each simulation for plotting and,
ideally, put it in a matrix.
A simple example
v1 <- 1:5
v2 <- 6:10
other1 <- "stuff"
other2 <- "stuff"
set1 <-
2007 Apr 28
1
The confidence level of p-value of ks.boot
Hello!
I need to compare 2 datasets whether they come from the same distribution. I use function ks.boot{Matching}. And what is the confidence level of the p-value, returned by ks.boot function?
The code is:
set=read.table("http://stella.sai.msu.ru:8080/~gala/data/testsets.csv",
header=T,sep=',')
set1=set[!is.na(set$set1),'set1']
2004 Jul 31
1
Win Integration: possible solution?
Hi. Back again...
I'm still looking for a possible integration of MIT K5 and AFS through
the windows login, so I will ask you a question.
A first considerations is that afs+k5 works fine but we have to create a
local account with a fake password. The profile will be on the local
disk. We can gain tickets and the token necessary to access \\AFS. The
problem is: how to avoid a local account?
2012 May 15
2
Renaming names in R matrix
I have the following matrix:
> dat
[,1] [,2] [,3] [,4]
foo 0.7574657 0.2104075 0.02922241 0.002705617
foo 0.0000000 0.0000000 0.00000000 0.000000000
foo 0.0000000 0.0000000 0.00000000 0.000000000
foo 0.0000000 0.0000000 0.00000000 0.000000000
foo 0.0000000 0.0000000 0.00000000 0.000000000
foo 0.0000000 0.0000000 0.00000000 0.000000000
and given this:
2010 Apr 14
2
GAMM : how to use a smoother for some levels of a variable, and a linear effect for other levels?
Hi,
I was reading the book on "Mixed Effects Models and Extensions in
Ecology with R" by Zuur et al.
In Section 6.2, an example is discussed where a gamm-model is fitted,
with a smoother for time, which differs for each value of ID (4
different bird species). In earlier versions of R, the following code
was used
BM2<-gamm(Birds~Rain+ID+
2007 Nov 08
1
ggplot2
Dear r-helpers,
I'm using ggplot2::ggplot to plot seven time series on the same graph.
c <- ggplot(jobm, aes(y = value, x = year, colour = kind))
c + stat_smooth()
This gives me a legend with colors that are not very different. Can I
label the lines instead? How?
_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box
2011 Jul 13
1
UNIX diff function
Colleagues,
(R: 2.13.0; OS X)
I often receive sequential datasets in which there are new rows interposed between existing rows. For example:
SET1 <- data.frame(list(LETTERS=LETTERS[c(1:4, 6:10)], NUMBERS=c(1:4, 6:10)))
SET2 <- data.frame(list(LETTERS=LETTERS[1:10], NUMBERS=1:10))
> SET1
LETTERS NUMBERS
1 A 1
2 B 2
3 C 3
4 D 4
5
2007 Sep 08
1
Problem with the aggregate command
Dear friends,
I have a data set with 23 columns and 38000 rows. It is a panel running from the years 1991 through 2005. I want to aggregate the data and get the medians of each of the 23 columns for each of the years. In other words my output should be like this
Year Median
1991 123
1992 145
1993 132
etc.
The sample lines of code to do this operation is
set1 <-
2005 Feb 28
2
Two offices connection
I would like connect two offices where one office have 4 PSTN Analog lines
and another office without any PSTN. Both the offices will have two separate
Asterisk server with TDM400P cards (4 ports FXS & FXO).
My questions is that how to configure Asterisk to forward the PSTN calls
directly
to another Asterisk which has the TDM400P card without pressing the
extension
number.
Diagram like
2005 Mar 01
1
constraining initial slope in smoother.spline
Hello. I want to fit a smoother spline (or an equivalent local
regression method) to a series of data in which the initial value of the
1st derivative (slope) is constrained to a specific value. Is it
possible to do this? If so, how?
Bill Shipley
[[alternative HTML version deleted]]