[R] Graphic functions in the ade4TKGUI graphic user interface in R

2019-05-28 Thread Ahmed Attia
, plabels.boxes.draw = TRUE, : non convenient selection for dfxy (can not be converted to dataframe) Any suggestions. Thanks Ahmed Attia, Ph.D. Agronomist & Crop Modeler __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

[R] Maximum number of iterations (maxit) does not work in hydroPSO-modFit-optimr in r

2018-10-03 Thread Ahmed Attia
ist(numiter=3)) res= optimr(par=xopt,my.function,method="L-BFGS-B", lower=xmin,upper=xmax,control=list(maxit=3,trace=T)) #Only the hjkb form dfoptim that has argument maxfeval and it works. res=hjkb(par=xopt,my.function, lower=xmin,upper=xmax,control=list(max

Re: [R] r-data partitioning considering two variables (character and numeric)

2018-08-27 Thread Ahmed Attia
Thanks Bert, worked nicely. Yes, genotypes with only one ID will be eliminated before partitioning the data. Best regards Ahmed Attia On Mon, Aug 27, 2018 at 8:09 PM, Bert Gunter wrote: > Just partition the unique stand_ID's and select on them using %in% , say: > > id

[R] r-data partitioning considering two variables (character and numeric)

2018-08-27 Thread Ahmed Attia
did not produce the desired output, the data are partitioned within the stand_ID. For example, one row of stand_ID 7 goes to training and two rows of stand_ID 7 go to testing. How can I partition the data by Genotype and stand_ID together?. Ahmed Attia __ R-h

Re: [R] netCDF to GeoTIFF by layer in r

2018-03-28 Thread Ahmed Attia
Hi Ben, Adding 'band' to raster provided what I want; importnetcdf <- raster(file.nc,band=4) writeRaster(importnetcdf,file.tiff,"GTiff",overwrite=FALSE) Thanks for your help. Ahmed Ahmed Attia, Ph.D. Agronomist & Soil Scientist On Wed, Mar 28, 2018 at 11:53 AM,

[R] Fwd: netCDF to GeoTIFF by layer in r

2018-03-28 Thread Ahmed Attia
6800, 43200, 72576 (nrow, ncol, ncell) resolution : 0.0083, 0.0083 (x, y) extent : -180, 179.9998, -56, 83.5 (xmin, xmax, ymin, ymax) coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 data source : C:\Users\Ahmed\Documents\file.tif names :

Re: [R] LSD-test

2017-12-25 Thread Ahmed Attia
The model should be class aov or lm and my model class is aovlist. tried tidy from broom library but did not work. To make it class aov, I had to remove the error term; model <- aov(Rotationdata_R$`GY(Mg/ha)`~Rep+code*as.factor(Nitrogen),data=Rotationdata_R) Ahmed Attia, Ph.D. Agronomist &am

[R] LSD-test

2017-12-25 Thread Ahmed Attia
ass "c("aovlist", "listof")" to a data.frame What is wrong with this. Ahmed Attia, Ph.D. Agronomist & Soil Scientist __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-hel

[R] Using nls.lm to fit a non-continuous dates range

2017-07-25 Thread Ahmed Attia
odel a_start<-8 b_start<-2*log(2)/a_start m<-nls(df$Y~a*exp(-b*df$days),start=list(a=a_start,b=b_start)) Error in nls(df$Y ~ a * exp(-b * df$days), start = list(a = a_start, b = b_start)) : parameters without starting value in 'data': Y, days Could you please help Thank you Ahm

Re: [R] Convert date to continuous variable in R

2017-07-06 Thread Ahmed Attia
ew=TRUE) plot(LAI~Date, data=LAI_simulation,xlab="",ylab="", xaxt="n",type="p",cex=0.2,col=1,xaxs="i",yaxs="i",ylim=c(0,6)) axis.Date(side=3, at=seq(min(LAI_simulation$Date), max(LAI_simulation$Date),by="year"), format="

[R] Convert date to continuous variable in R

2017-07-05 Thread Ahmed Attia
LAI~Date, data=LAI_simulation) LAI_simulation$Date<- as.numeric(LAI_simulation$Date,origin="2009-10-07") #R does not see the origin axis.Date(side=3,at=LAI_simulation$Date) Ahmed Attia, Ph.D. Agronomist & Soil Scientist [[alternative

Re: [R] Predict

2017-06-30 Thread Ahmed Attia
= 2016, frequency =365) plot(forecast(ets(Stand_Height),10)) a=seq(as.Date("2009-12-01"),by="weeks",length=11) axis(1, at = a, labels = format(a, "%Y %b %d"), cex.axis=0.6) #Error :$ operator is invalid for atomic vectors Thanks Ahmed Attia, Ph.

[R] Predict

2017-06-30 Thread Ahmed Attia
<- predict(lm(height~Date, data=Stand_Height)); dl=leafbiom$Date[i-1]; de=leafbiom$Date[i]; SH[i]=sum(SH[leafbiom$Date==de$Date==dl]) } SH The SH output is the prediction of Stand height in 25 observations only and provides NA for the remaining 2616 iterations. Thanks for your help. Ah

[R] For loop

2017-06-22 Thread Ahmed Attia
quot;i"])/2) } #Error in charToDate(x) : Thanks for your help Ahmed Attia, Ph.D. Agronomist & Soil Scientist __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

Re: [R] Help/ Mathematics

2017-06-22 Thread Ahmed Attia
uot;2012-02-12"] - leafbiom97$LeafBiog[leafbiom97$Date == "2010-03-15"]+ Litterfall_Ahmed97$littperiod[Litterfall_Ahmed97$Date =="2011-04-08"])/ (sum(GPP_Ahmed13$GPP[GPP_Ahmed13$Date >= "2010-03-12" & GPP_Ahmed13$Date <= "2012-04-12"])/2)

[R] Help/ Mathematics

2017-06-21 Thread Ahmed Attia
format. Which library or function Should I use to tell R do these calculations of these variables at different dates. I appreciate your help. Ahmed Attia, Ph.D. Agronomist & Soil Scientist __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

[R] pch size in a legend

2015-01-30 Thread Ahmed Attia
Hi R users, I would like to adjust the pch size in a legend without changing the text size, pt.cex does not do the job. R 2.15.2 32 bit. legend(0,2100, legend=c(2009,2010,2012,2013,2014), col = 1,cex=1,lty=NA,pch=c(1,2,6,7,8),lwd=2,bty=n) Thanks Ahmed Attia, Ph.D. Agronomist Soil Scientist

Re: [R] Specifying strip names in xyplot (strip.custom)

2015-01-17 Thread Ahmed Attia
)) } ) ## I want to force the model to write the names of locations as Concord,HAL,Pierce from top to bottom instead of Loc. Thanks for your help. Ahmed Ahmed Attia, Ph.D. Agronomist Soil Scientist Post-Doc Research Associate Texas AM AgriLife Research-Vernon ahmed.at...@ag.tamu.edu

[R] Specifying strip names in xyplot (strip.custom)

2015-01-16 Thread Ahmed Attia
=), cex=0.65, adj=0) ltext(50,19.5,paste(Intercept = ,round(summary(m1)$coef[ 1,c(1,4) ],3),sep=), cex=0.65, adj=0) print(summary(m1)) } ) Ahmed Attia, Ph.D. *Agronomist Soil Scientist* Post-Doc Research

[R] Fwd: Plot the means with simultaneous horizontal and vertical error bars

2014-07-18 Thread Ahmed Attia
Dear R users, I would appreciate your help in plotting the means with simultaneous horizontal and vertical error bars. I use the lineplot.CI but it creates the vertical bars only. The attached file has the dataset that I want to graph. The (X) is the x-axis values and (y Lint) is the response

[R] Fwd: Plot the means with simultaneous horizontal and vertical error bars

2014-07-18 Thread Ahmed Attia
Hi all, I have been also trying the plotCI but it did not work out plotCI(x, y = NULL, uiw, liw = uiw, ui, li, err='y', ylim=NULL, xlim=NULL, type=p, col=par(col), barcol=col, pt.bg = par(bg), sfrac = 0.01, gap=1, lwd=par(lwd), lty=par(lty), labels=FALSE, add=FALSE, xlab,

Re: [R] Fwd: Plot the means with simultaneous horizontal and vertical error bars

2014-07-18 Thread Ahmed Attia
) err.x-runif(10) err.y-runif(10) plotCI(1:10,y,err.y,pt.bg=par(bg),pch=21,xlim=c(0,11), main=plotCI with extra space on the x axis) plotCI(1:10,y,err.x,pt.bg=par(bg),pch=21,err=x,add=TRUE) Sarah On Fri, Jul 18, 2014 at 6:06 PM, Ahmed Attia ahmedati...@gmail.com

[R] Tick marks at the 0:0 point in a plot ()

2014-05-05 Thread Ahmed Attia
Dear R usres, Sorry to bother you with my basic question. I have a quick question about tick mark in R. A reviewer wants the tick marks of the graph to start at 0:0 point. My current code below produces the tick mark a little far from the corner; plot(Simu2~Irrig, data=Ahmed,pch=17,

Re: [R] Tick marks at the 0:0 point in a plot ()

2014-05-05 Thread Ahmed Attia
to be at the lower left corner of the plot? If so, see if adding xaxs=i, yaxs=i to your plot command helps. E.g., compare plot(0:10,0:10, xaxs=i, yaxs=i) and plot(0:10,0:10) Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, May 5, 2014 at 11:27 AM, Ahmed Attia ahmedati...@gmail.com wrote

[R] Tick marks at the 0:0 point in a plot ()

2014-05-04 Thread Ahmed Attia
Dear R usres, Sorry to bother you with my basic question. I have a quick question about tick mark in R. A reviewer wants the tick marks of the graph to start at 0:0 point. My current code below produces the tick mark a little far from the corner; plot(Simu2~Irrig, data=Ahmed,pch=17,

[R] xyplot y scale label help

2014-04-16 Thread Ahmed Attia
Hi R usres, I would like to specify y label units in xyplot. I tried the yaxp, but it does not work. Following are my codes; trellis.device(col=F) xyplot(GY~N|S,data = Ahmed, layout=c(5,1,1), xlab=expression(paste(N rate (kg , ha^-1,))), ylab=expression(paste(Biomass yield (Mg ,ha^-1,))),

[R] linear line in x, y plot

2013-10-28 Thread Ahmed Attia
Hi I have a question about drawing a linear line in x, y plot. I usually use the following code, but for this time the x values are to small (-0.08 to -0.02) I wrote the following code, but r does not draw the line. However, it does not give an error when it takes the code. reg1- lm(CWSI~NWI,

[R] Text in a plot without x axis

2013-10-24 Thread Ahmed Attia
Dear R users, Can I add a text to a plot without x axis? I saw a function that enables placing the text with mouse text(location, text to place, pos, ...) locator(1) but it did not work out. -- Ahmed M. Attia Research Assistant Dept. Of SoilCrop Sciences Texas AM University

[R] Custom x axis in a boxplot

2013-10-24 Thread Ahmed Attia
Dear R users, How can I customize x axis in a boxplot? xaxt=n to suppress x axis, but I would like to customize x axis for different groups. Thanks -- Ahmed M. Attia Research Assistant Dept. Of SoilCrop Sciences Texas AM University ahmed.at...@ag.tamu.edu Cell phone: 001-979-248-5215

[R] Nash-Sutcliffe coefficient

2013-10-20 Thread Ahmed Attia
Hi Could you please inform how can I get the Nash-Sutcliffe coefficient in r? Comparing observed vs. simulated values. Appreciated -- Ahmed M. Attia Research Assistant Dept. Of SoilCrop Sciences Texas AM University ahmed.at...@ag.tamu.edu Cell phone: 001-979-248-5215

[R] Fwd: axis lab font in r

2013-09-17 Thread Ahmed Attia
-- Forwarded message -- From: Ahmed Attia ahmedati...@gmail.com Date: Tue, Sep 17, 2013 at 11:17 AM Subject: axis lab font in r To: r-help-requ...@r-project.org I have an a question about the axis lab font in r. I use font.lab, but r changes the font of x axis lab only. How I

[R] Importing data by odbcConnectExcel in 64 bit

2013-07-16 Thread Ahmed Attia
I have probably an old question. I have R.3.0.1 installed in 64 bit windows 7. The odbcConnectExcel in RODBC library does not work. Tried odbcConnectExcel2007 still does not work. Any ideas. Thanks Melissa-sqlFetch(odbcConnectExcel2007(F:\\Cotton2012\\validation.xlsx),sqtable = Sheet3, +

[R] Fwd: Help with nonlinear regression

2013-01-14 Thread Ahmed Attia
-- Forwarded message -- From: r-help-ow...@r-project.org Date: Mon, Jan 14, 2013 at 12:31 AM Subject: Help with nonlinear regression To: ahmedati...@gmail.com The message's content type was not explicitly allowed -- Forwarded message -- From: Ahmed Attia

[R] Fwd: Help with nonlinear regression

2013-01-14 Thread Ahmed Attia
-- Forwarded message -- From: Ahmed Attia ahmedati...@gmail.com Date: Mon, Jan 14, 2013 at 2:31 AM Subject: Help with nonlinear regression To: r-help@r-project.org Dears- I have a question about nonlinear regression. Asymptotic Regression Model below is the equation

[R] Getting the R squared value in asymptotic regression model

2013-01-12 Thread Ahmed Attia
Please help getting the R squared value in asymptotic regression model I use the code below model1-nls(GN1~SSasymp (nrate,a,b,c), data = data.1 ) and R produced the modell coefficients without the R squared value? -- Ahmed M. Attia Research Assistant Dept. Of SoilCrop Sciences Texas AM

[R] Fwd: Fwd: R help

2010-11-21 Thread Ahmed Attia
On 11/21/10 11:24, Ahmed Attia wrote: -- Forwarded message -- From: Ahmed Attia ahmedati...@gmail.com Date: Sun, Nov 21, 2010 at 11:06 AM Subject: R help To: r-help@r-project.org Dear All, I'm a beginner user in R and I would like to make a quadratic plus plateau

[R] Help with linear plus plateau fit model

2010-11-21 Thread Ahmed Attia
Dear R users, If you could please provide an example with the data set for the linear plus plateau model in R. I've 5 N rates and I need to make this model between N rates and grain Yield. Thanks so much Ahmed -- Ahmed M. Attia Assistant Lecturer El-Khattara farm Station Agronomy Dept.,

[R] R help

2010-11-21 Thread Ahmed Attia
Dear All, I'm a beginner user in R and I would like to make a quadratic and plateau model in R. Can you help please with an example? Thanks so much -- Ahmed M. Attia Assistant Lecturer El-Khattara farm Station Agronomy Dept., Zgazig Univ., Egypt Visiting Scientist Haskell Agricultural