[R] Plotting with 2 y axes

2007-10-12 Thread Keith Cox
eed resistance plotted on one y axis and Temperature plotted on the second. Thanks in advance, keith Marlin Keith Cox Ph.D. At-Sea Processor Professorship of Fisheries Biology Science Chair Sheldon Jackson College Sitka, Alaska 99835 907.747.5296 http://www.sheldonjackson.edu

[R] Repeated Measures/Linear Mixed Effects function

2007-10-22 Thread Keith Cox
56 c 5 63.6 d 5 51 e 5 56.6 f 5 Marlin Keith Cox Ph.D. At-Sea Processor Professorship of Fisheries Biology Science Chair Sheldon Jackson College Sitka, Alaska 99835 907.747.5296 http://www.sheldonjackson.edu

[R] dates by week multiple years

2019-02-05 Thread Marlin Keith Cox
such as 53, 54, 55, 56, etc. instead of starting over? Below has worked for me until we moved into 2019. data$Date<- as.Date(data$TIMESTAMP,format="%m/%d/%y %H:%M") data$Week1<- strftime(data$Date,format = "%V") data$Week<-as.factor(data$Week1) Keith

[R] Reordering of numerical vector

2015-10-21 Thread Marlin Keith Cox
other order. I am a fairly experienced R user and I cannot find the answer anywhere. I am certain it is simple as these things usually are for me. Thank you ahead of time. Keith M. Keith Cox, Ph.D. Principal MKConsulting 17105 Glacier Hwy Juneau, AK 99801 U.S. 907.957.4606 [[alternative

Re: [R] Reordering of numerical vector

2015-10-21 Thread Marlin Keith Cox
Got it. During a read.csv I used stringsAsFactors=FALSE M. Keith Cox, Ph.D. Principal MKConsulting 17105 Glacier Hwy Juneau, AK 99801 U.S. 907.957.4606 On Wed, Oct 21, 2015 at 10:31 AM, Marlin Keith Cox wrote: > I do not have a dataset to share as I do not believe it needs it and I am &g

[R] error.crosses

2016-04-27 Thread Marlin Keith Cox
7.17 7.17 0.00 NaN NaN Supplier*3 6 NaN NA NA NaN NA Inf -Inf -Inf NA NA se CQN 2.33 Price 0.00 Supplier* NA M. Keith Cox, Ph.D. Principal MKConsulting 17415 Christine Ave. Juneau, AK 99801 U.S. 907.957.4606 [[alternative HTML versi

[R] error.crosses

2016-04-27 Thread Marlin Keith Cox
7.17 7.17 0.00 NaN NaN Supplier*3 6 NaN NA NA NaN NA Inf -Inf -Inf NA NA se CQN 2.33 Price 0.00 Supplier* NA M. Keith Cox, PhD Assistant Professor of Biology Natural Sciences Coordinator Alaska Native Science and Engineering Program (ANSEP) 111

[R] Matrix addition and multiplication

2009-08-10 Thread Marlin Keith Cox
-.27,-.08,.10,.29,.47) actual=Xcp X=((R%o%x+R)) Y=(Xc%o%y+Xc) num.x.col <- length(X[1,]) num.y.col <- length(Y[1,]) num.rows <- length(X[,1]) Z <- matrix(nrow=num.rows, ncol=num.x.col*num.y.col) for( i in 1:num.rows) { Z[i,] <- as.vector(X[i,] + ((Y[i,])^2 %*% t(X[i,])^-1

[R] Axes origins and labeling

2009-07-15 Thread Marlin Keith Cox
ss", ylab="Reactance (Ohms)", axes=FALSE,ylim=c(50,200)) axis(side=1, at=c(1,2,3,4), labels=gut) axis(side=2) text(1.5,115, "Mid BIA") text(3.5,160, "Whole BIA") points(1,135, pch=2) points(2,135, pch=2) points(3,135, pch=17) points(4,135, pch=17) Thanks ahead of t

[R] axis label config mgp

2009-07-15 Thread Marlin Keith Cox
,mar=c(16.1,10.1,4.1,2.1), mgp=c(10,1,0)) boxplotR<-boxplot(R ~ Trt, xlab="Configuration",ylab="Resistance (Ohms)", xaxt='n', cex.axis=1.6,cex.lab=1.6) axis(side=1, at=c(1,2,3,4,5,6), labels=conif, las=2, cex.axis=1.4) -- kc Keith Cox, Ph.D. Alaska NOAA Fisheri

[R] wireframe color change from default

2009-07-30 Thread Marlin Keith Cox
mass error (%)",rot=92), zlim=c(-50,180), xlab = list("Resistance error (%)",rot=16), ylab = list("Length error (%)",rot=118), scales = list(arrows = FALSE), screen = list(z = 20, x = -57, y = 5)) Thanks ahead of time. -- M. Keith Co

[R] wireframe color

2009-07-30 Thread Marlin Keith Cox
mass error (%)",rot=92), zlim=c(-50,180), xlab = list("Resistance error (%)",rot=16), ylab = list("Length error (%)",rot=118), scales = list(arrows = FALSE), screen = list(z = 20, x = -57, y = 5)) Thanks ahead of time. -- M. Keith Co

[R] wireframe color

2009-08-03 Thread Marlin Keith Cox
mass error (%)",rot=92), zlim=c(-50,180), xlab = list("Resistance error (%)",rot=16), ylab = list("Length error (%)",rot=118), scales = list(arrows = FALSE), screen = list(z = 20, x = -57, y = 5)) Thanks ahead of time. -- M. Keith Co

[R] Matrix function

2009-08-06 Thread Marlin Keith Cox
- length(X[1,]) num.y.col <- length(Y[1,]) num.rows <- length(X[,1]) Z <- matrix(nrow=num.rows, ncol=num.x.col*num.y.col) for( i in 1:num.rows) { Z[i,] <- as.vector(X[i,] + ((Y[i,])^2 %*% t(X[i,])^-1 )) } -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marin

[R] t.test data in one column

2010-04-01 Thread Marlin Keith Cox
run a two sample t.test with data in one column. x=rep(c(1,2,3,4),2) y=rep(c("M","M","M","M","F","F","F","F")) data<-cbind(x,y) t.test(x,by=list(y)) Thank you ahead of time. keith -- M. Keith Cox, Ph.D. Alas

[R] Time Series Data

2009-10-19 Thread Marlin Keith Cox
Hi all and thanks in advance. I am regressing Time and Weight, and then predicting Weight at different Time. The format of the Time data is day/month/year. How can I get R to use time series data such as this? Keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries

[R] Boxplots

2010-01-09 Thread Marlin Keith Cox
" vs. "cons_hat". boxplot(Total~tank) of course creates a boxplot with only Total by tank, but how do I put the other column in this boxplot? Thanks ahead of time. keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt.

[R] Point plot comparisions

2010-01-10 Thread Marlin Keith Cox
h5 6.713422 6.44 9hh6 5.168555 5.62 Keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Juneau, AK 99801 keith@noaa.gov marlink...@gmail.com U.S. (907) 789-6603 [[alternative HTML version

[R] first and second derivative calculation

2010-01-22 Thread Marlin Keith Cox
="x-values", ylab="f(x)", type="l") But would like to similarly plot the curve for both the first and second derivatives. I can calculate the derivatives by hand but would like to get R to do this for me. by hand: H'(t) = 3*t^2 - 12*t + 5 H''(t) = 6

Re: [R] first and second derivative calculation

2010-01-22 Thread Marlin Keith Cox
2 > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Marlin Keith Cox > Sent: Friday, January 22, 2010 4:37 PM > To: r-help@r-project.org > Subject: [R] first and second derivative calculation > > I wo

[R] Subset and point plot

2010-02-02 Thread Marlin Keith Cox
set=Foodin>1 & Rep==2 & Grp=="fed" & Tanks=="a4"| Foodin>1 & Rep==2 & Grp=="fed" & Tanks=="c4"|Foodin>1 & Rep==2 & Grp=="fed" & Tanks=="h4") attach(daily) x11() par(cex=1.4) plot(Day, Wgt col=c(&

[R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
aily.sub1<-as.data.frame(daily.sub) attach(daily.sub1) daily.sub1 x11() plot(Day, Wgt) #plot(Day, Wgt, pch=c(2,19,21)[Tanks]) detach(daily.sub1) -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Juneau, AK 99801

Re: [R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
gt; > c(2,19,21)[Tanks] > with(daily.sub1,c(2,19,21)[Tanks]) > > Avoid attach and use with which is a temporary attach that won't be subject > to that problem. > > --jeff > > On 2/2/2010 11:51 AM, Marlin Keith Cox wrote: > >> Here is a runable program. Wh

Re: [R] Subset and plot

2010-02-02 Thread Marlin Keith Cox
otting symbols and ``Tanks'' has *four* distinct > values, this is somewhat mysterious. > > If you would just tell us what you are actually trying to *do* we would > probably be able to tell you how to do it. > >cheers, > >

[R] simple subtraction in a single vector

2010-02-09 Thread Marlin Keith Cox
OK, this is very elementary, but I need help. I have looked in Verzani, past postings etc. Problem: I need to subtract the "length" date between "h4" and "a3" #which would be 4-1 I would rather not convert the two columns into four columns (with headings being "a3","a4","c4","h4"). DF <- data

[R] correlation by factor

2021-07-27 Thread Marlin Keith Cox
approach my problem this way. Data is below. Keith R<-c(1,8,3,6,7,2,3,7,2,3,3,4,3,7,3) Day<-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3) Freq<-(a1,a2,a3,a4,a5,a1,a2,a3,a4,a5,a1,a2,a3,a4,a5,) M. Keith Cox, Ph.D. Principal MKConsulting 17415 Christine Ave. Juneau, AK 99801 U.S. 907

[R] Time series and correlation

2022-04-26 Thread Marlin Keith Cox
ctionality of giving correlations by Frequency works, but not when Time is used. I hope this is clear enough. keith M. Keith Cox, Ph.D. Principal MKConsulting 17415 Christine Ave. Juneau, AK 99801 U.S. 907.957.4606 [[alternative HTML version deleted]] ___

[R] Contract work for non-linear regressions

2022-05-09 Thread Marlin Keith Cox
I am not sure if this is appropriate here, my apologies if not. I have used R for 20 years now and need help with non-linear regression analysis over 100's of different frequencies and my data has exceeded by R program capabilities. My company would provide the contract. keith M. Keit

[R] X11 and printing/copying graphics from mac

2013-08-01 Thread Marlin Keith Cox
multiple graphic windows is a must as well as being able to print or copy from them. Thanks ahead of time. Keith M. Keith Cox, Ph.D. Principal MKConsulting 17105 Glacier Hwy Juneau, AK 99801 U.S. 907.957.4606 [[alternative HTML version deleted

[R] Subsets of a function

2014-05-19 Thread Marlin Keith Cox
") size.2011b<-subset(size,Year==2011&Season=="b") size.2012b<-subset(size,Year==2012&Season=="b") size.2013b<-subset(size,Year==2013&Season=="b") The smooth.spline is below 2003<-with(size.2003,smooth.spline(Size,Prop,spar=0.25)) 2004&l

[R] Time series and lm

2013-12-17 Thread Marlin Keith Cox
Time1 ~ pa.s, drop.unused.levels = TRUE) : invalid type (list) for variable 'Time1' I cannot figure it out. Keith M. Keith Cox, Ph.D. Principal MKConsulting 17105 Glacier Hwy Juneau, AK 99801 U.S. 907.957.4606 [[alternative HTML version deleted]]

[R] predict model time series

2014-02-21 Thread Marlin Keith Cox
en hopefully use the logic and apply it to my gam model predictions. Thanks, Keith M. Keith Cox, Ph.D. Principal MKConsulting 17105 Glacier Hwy Juneau, AK 99801 U.S. 907.957.4606 [[alternative HTML version deleted]] __ R-help@r-project.org

[R] Time series

2014-04-01 Thread Marlin Keith Cox
19/13 17:29 13.1 9/19/13 18:29 13 9/20/13 18:29 12 9/21/13 18:29 10 9/22/13 18:29 9 9/23/13 18:29 7 9/24/13 18:29 5 9/25/13 18:29 3 9/26/13 18:29 2 9/27/13 18:29 1 M. Keith Cox, Ph.D. Principal MKConsulting 17105 Glacier Hwy Juneau, AK 99801 U.S. 907.957.4606 [[alternative HTML

[R] grayscale wireframe??

2010-07-06 Thread Marlin Keith Cox
",rot=-9), ylab = list("Length error (%)",rot=38), scales = list(arrows = FALSE), screen = list(z = -35, x = -77, y = 10)) -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Jun

[R] hide scatter points

2010-07-09 Thread Marlin Keith Cox
h=16, col="green") model<-lm(y2~x2) abline(model, lty=3, lwd=4, col="black") Thanks ahead of time, keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Juneau, AK 99801 keith@noaa.gov m

[R] move colorkey

2010-09-28 Thread Marlin Keith Cox
to move the colorkey other than right, left, bottom and top. I do not understand corner interacts with x, y; unimplemented. Is this a way to place a colorkey. keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Ju

[R] nls self starting function

2010-08-25 Thread Marlin Keith Cox
) model<-nls(y~SSasymp(t,a,b)) summary(model) Thanks in advance, keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Juneau, AK 99801 keith@noaa.gov marlink...@gmail.com U.S. (907) 789-6603 [[alt

[R] non-linear plot parameters

2010-08-26 Thread Marlin Keith Cox
4, 42, 38, 40, 37, 37, 35, 40, 34, 32, 20, 22, 25, 27, 29) plot(Time,Level,pch=16) Keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Juneau, AK 99801 keith@noaa.gov marlink...@gmail.com U.S. (90

Re: [R] non-linear plot parameters

2010-08-26 Thread Marlin Keith Cox
:48 AM, David Winsemius wrote: > > On Aug 26, 2010, at 1:35 PM, Marlin Keith Cox wrote: > > I need the parameters estimated for a non-linear equation, an example of >> the >> data is below. >> >> >> # rm(list=ls())I really wish people would add

Re: [R] non-linear plot parameters

2010-08-26 Thread Marlin Keith Cox
10 at 1:42 PM, David Winsemius wrote: > > On Aug 26, 2010, at 5:20 PM, Marlin Keith Cox wrote: > > The background you requested are energetic level (joules) in a group of > starved fish over a time period of 45 days. Weekly, fish (n=5) were removed > killed and measured for

Re: [R] non-linear plot parameters

2010-08-26 Thread Marlin Keith Cox
know how to do this, seek further statistical help. > > -- > Bert Gunter > Genentech Nonclinical Statistics > > > > > > The data originally posted was an example of one of the curves > experienced. > > > > kc > > > > On Thu, Aug 26, 20

Re: [R] non-linear plot parameters

2010-08-31 Thread Marlin Keith Cox
-Peter Ehlers > > > >> (which will often give the converged values). You can >> follow up with >> >> fm <- nls(Level ~ Asym-Drop*exp(-exp(lrc)*Time^pwr), start = init) >> >> -Peter Ehlers >> >> >>> kc >>> On Thu, Aug 26, 20

Re: [R] non-linear plot parameters

2010-09-01 Thread Marlin Keith Cox
e-12),trace=TRUE) > summary(model) > > As always, thank you...keith > > > > > On Fri, Aug 27, 2010 at 10:59 AM, Peter Ehlers wrote: > >> Just a small fix to my solution; inserted below. >> >> >> On 2010-08-27 3:51, Peter Ehlers wrote: >>

[R] NLS equation self starting non linear

2010-09-02 Thread Marlin Keith Cox
ot;) model<-nls(joules~a+b*exp(-c*Days),start=list(a=8,b=9,c=-.229), control=list(minFactor=1e-12),trace=TRUE) summary(model) init <- nls(Joules~ SSweibull(Days,Asym,Drop,lrc,pwr), control=list(minFactor=1e-12),data=.GlobalEnv) init Data here is reproducible. As always, thank you...keith --

[R] color under lm line

2011-03-14 Thread Marlin Keith Cox
#x27;) abline(llm) keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Juneau, AK 99801 keith@noaa.gov marlink...@gmail.com U.S. (907) 789-6603 [[alternative HTML ve

Re: [R] color under lm line

2011-03-14 Thread Marlin Keith Cox
: > > co <- coef(llm) > bord <- pmin(y, co[1] + co[2] * x) > plot(x,y) > polygon(c(x, x[length(x)]), c(bord, bord[1]), col = 'red') > abline(co) > > HTH, > Dennis > > On Mon, Mar 14, 2011 at 4:02 PM, Marlin Keith Cox > wrote: > >>

[R] Plot label symbols and superscript

2011-08-19 Thread Marlin Keith Cox
I was unable to find an answer to my problem. I would like to label the y axis of a plot with a rate and would like to use a dot (•) rather than a multiplication sign (x). ylab = quote(Speed~(cmxsec^2)) Thanks in advance. keith -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine

[R] subset and plot

2008-04-21 Thread Marlin Keith Cox
91 brook_dis nh 92 brook_dis nh 93 brook_dis nh 94 brook_dis nh 95 brook_dis nh 96 brook_dis nh 97 -- Keith Cox, Ph.D. Sitka Sound Science Center Fisheries Biologist P.O. Box 464 Sitka, Alaska, 99835 907 752-0563 [EMAIL PROTECTED] [[alternative HTML version deleted]]

[R] subset and boxplots

2008-04-22 Thread Marlin Keith Cox
84 brook_dis h 85 brook_dis h 86 brook_dis h 87 brook_dis h 88 brook_dis h 89 brook_dis h 90 brook_dis h 91 brook_dis nh 92 brook_dis nh 93 brook_dis nh 94 brook_dis nh 95 brook_dis nh 96 brook_dis nh 97 brook_dis nh 98 brook_dis nh 99 brook_dis nh

[R] predict.lm with matrix as newdata

2008-02-15 Thread Marlin Keith Cox
rame(x=Z)) Thanks in advance, keith -- Keith Cox, Ph.D. Sitka Sound Science Center Fisheries Biologist P.O. Box 464 Sitka, Alaska, 99835 907 752-0563 [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] wire.frame tick labels from matrix

2008-02-15 Thread Marlin Keith Cox
olMeans(z) mat.x <- matrix(meanz, nrow=6, ncol=6, byrow=TRUE) colnames(mat.x)<- c(0,1,2,3,4,5) rownames(mat.x)<-c(0,5,10,15,20,25) mat.x library(lattice) wireframe(mat.x,drape=TRUE,zlab=list("Proportion Error of Estimate", rot=90), xlab="Resistance Error (%) ",ylab=&qu

Re: [R] predict.lm with matrix as newdata

2008-02-18 Thread Marlin Keith Cox
3.453*Z+1.994 pred.est1 <- predict.lm(model.lm, data.frame(Rs=Z)) pred.est pred.est1 detach(z) detach(sen) On Sat, Feb 16, 2008 at 2:10 AM, Uwe Ligges <[EMAIL PROTECTED]> wrote: > > > Marlin Keith Cox wrote: > > Z is a matrix and when I run the following line, it creates a pred

[R] Matrix addition

2008-02-19 Thread Marlin Keith Cox
aking this be Y + X/Y would be appreciated. -- Keith Cox, Ph.D. Sitka Sound Science Center Fisheries Biologist P.O. Box 464 Sitka, Alaska, 99835 907 752-0563 [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mai

[R] addition of matrix

2008-02-19 Thread Marlin Keith Cox
ngth(X[,1]) Z <- matrix(nrow=num.rows, ncol=num.x.col*num.y.col) for( i in 1:num.rows) { Z[i,] <- as.vector(X[i,] %*% t(Y[i,])^-1 ) } Any help with making this be Y + X/Y would be appreciated. -- Keith Cox, Ph.D. Sitka Sound Science Center Fisheries Biologist P.O. Box 464 Sitka, Ala