[R] density in hist does not come as 1

2014-05-20 Thread vikram ranga
Dear List, I am trying to make a histogram with following data: dput(a) c(1, 0, 1.5, 1, 0, 0, 0, 1, 1.5, 0, 0, 1, 0, 0, 0, 1, 1, 2, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0.5, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1.5, 0, 0, 0, 0, 1, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1,

Re: [R] density in hist does not come as 1

2014-05-20 Thread Pascal Oettli
Hello, What you are doing wrong? Correctly read the help page. From the help page: if FALSE, probability densities, component density, are plotted (so that the histogram has a *total area of one*) sum(check$density * diff(check$breaks)) [1] 1 HTH, Pascal On Tue, May 20, 2014 at 3:06 PM,

[R] How to include static PDFs vignettes in an R package

2014-05-20 Thread Luca Scrucca
Hi all, prior to R version 3.0 I used to include a static PDF file as package vignette following the instructions in http://www.icesi.edu.co/CRAN/web/packages/R.rsp/vignettes/NonSweaveVignettes.pdf (I know this is a little bit old), except that the relevant files where in vignette/ directory

Re: [R] Subsets of a function

2014-05-20 Thread ONKELINX, Thierry
Another option is the plyr package. library(plyr) result - dlply(size, ~ Year +Season, function(.sub){ with(.sub, smooth.spline(Size, Prop, spar = 0.25)) } ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie

Re: [R] Second axis on bottom of graph

2014-05-20 Thread Hurr
How can I: 1) make ticks shorter or longer 2) make ticks cross the axis line 3) make ticks project toward the plot 4) make grid lines 5) make perpendicular labels be close to the axis near ticks projecting away from the plot -- View this message in context:

[R] Documenting docType data

2014-05-20 Thread Witold E Wolski
Hi, I am Trying to document data using roxygen2 by following the stackoverflow question: http://stackoverflow.com/questions/9561684/documenting-dataset-with-roxygen2 And although my data resigin in mypackage/data has extension .rda and .csv I am getting the same error as in the stackoverlfow

[R] Variance of predictions from lme4 models at existing levels?

2014-05-20 Thread Julien Riou
Dear contributors, I know that this has been widely discussed, but even after having read many discussions on this matter, I'm still not sure if I'm understanding properly. So I have a dataset of studies reporting prevalence in several settings, here is an exemple:

[R] \ escape sequence and windows path

2014-05-20 Thread Knut Krueger
Is there any function to change the windows path to linux path? especially I would like to have the possibility to use f.e path=C:\foo1\foo2\ I can import those paths with path = readline() but not directly in a script Regards Knut __

Re: [R] How to include static PDFs vignettes in an R package

2014-05-20 Thread Duncan Murdoch
On 20/05/2014, 2:51 AM, Luca Scrucca wrote: Hi all, prior to R version 3.0 I used to include a static PDF file as package vignette following the instructions in http://www.icesi.edu.co/CRAN/web/packages/R.rsp/vignettes/NonSweaveVignettes.pdf (I know this is a little bit old), except that the

Re: [R] Spatial Quantile Regression: Extracting residuals

2014-05-20 Thread Roger Bivand
Marie-Line GLAESENER Marie-Line.Glaesener at uni.lu writes: Dear R users, Could anyone tell me if there is a way to obtain the residuals from a model fitted by qregspiv(y ~ x,wmat=wmat,inst=NULL,tau=.5,rhomat = seq(-1,1,.01),printsariv=T,silent=F, nboot=300,data=) in McSpatial,

Re: [R] \ escape sequence and windows path

2014-05-20 Thread peter dalgaard
On 20 May 2014, at 12:37 , Knut Krueger r...@knut-krueger.de wrote: Is there any function to change the windows path to linux path? especially I would like to have the possibility to use f.e path=C:\foo1\foo2\ I can import those paths with path = readline() but not directly in a

Re: [R] Documenting docType data

2014-05-20 Thread Hadley Wickham
Don't export the dataset? (as mentioned in the answer to that question). If that doesn't help, please supply a minimal reproducible example. Hadley On Tue, May 20, 2014 at 3:35 AM, Witold E Wolski wewol...@gmail.com wrote: Hi, I am Trying to document data using roxygen2 by following the

Re: [R] Boxplots

2014-05-20 Thread Shane Carey
Thanks On Tue, May 20, 2014 at 2:21 AM, William Dunlap wdun...@tibco.com wrote: Another method uses the core boxplot() function but replaces the usual call to split() with a variant that puts all the data at the end of the list of splits: splitPlusAll - function(x, ...) c(split(x, ...),

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Jeff Newmiller
Most importantly, \\ is a string literal containing ONE backslash character. Yes you can create strings in R source code that represent Windows-style paths, but they must APPEAR different in that context. You may find it helpful to know that the print function can output escaped strings

[R] cumulative frequency distribution combined with histogram in one plot at two different scales

2014-05-20 Thread Shane Carey
Hi, I amtrying to plot a cfd with a histogram on one plot. The problem is the scale (y-axis) of the plots are hugely different and as a result the histogram plot is hard to read. Are there any examples of plots like this done in R:

[R] logLik in betareg()

2014-05-20 Thread ChrisR
Hi everyone, I have estimated different models with the betareg() command from the package 'betareg' (3.0-4). When I started to compare them using likelihood ratio tests, it occured to me that the logLik() of the models increased with increasing number of parameters. I confirmed this observations

Re: [R] Second axis on bottom of graph

2014-05-20 Thread Hurr
I had asked How can I: 1) make ticks shorter or longer 2) make ticks cross the axis line 3) make ticks project toward the plot 4) make grid lines 5) make perpendicular labels be close to the axis near ticks projecting away from the plot I figured out that par(tck=..) solves three of the

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Knut Krueger
Am 20.05.2014 15:22, schrieb Jeff Newmiller: Most importantly, \\ is a string literal containing ONE backslash character. Yes you can create strings in R source code that represent Windows-style paths, but they must APPEAR different in that context. You may find it helpful to know that the

Re: [R] \ escape sequence and windows path

2014-05-20 Thread David L Carlson
Annoying but easy. Would this work for you? y - gsub(, /, readline()) C:\foo1\foo2\ y [1] C:/foo1/foo2/ - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From:

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Bert Gunter
On Tue, May 20, 2014 at 7:54 AM, Knut Krueger r...@knut-krueger.de wrote: Am 20.05.2014 15:22, schrieb Jeff Newmiller: Most importantly, \\ is a string literal containing ONE backslash character. Yes you can create strings in R source code that represent Windows-style paths, but they must

[R] Variation Inflation factor for GLS

2014-05-20 Thread Laura Riggi
Dear all, I am running a gls and I would like to check the vif of my model. It seems that the vif function in the car package and the vif.mer function available online do not work for gls. Would you know of a method to measure variance inflation factors for GLS? Thank you Laura

Re: [R] Using centers of hierarchical clustering for k-means

2014-05-20 Thread marioger
Thank you very much for your help. everything works great -- View this message in context: http://r.789695.n4.nabble.com/Using-centers-of-hierarchical-clustering-for-k-means-tp4690704p4690870.html Sent from the R help mailing list archive at Nabble.com.

[R] Fitting multiple nonlinear regression lines with nlrob()

2014-05-20 Thread jlabo...@huskers.unl.edu
Greetings R community, I would like to regress a nonlinear trend onto several subsets of data (representing different treatments) within a dataset. In my case, I would like to fit a nonlinear trend to several different Tillage treatments. model.global = nlrob(FinalBiomass ~

[R] NppToR / RMySQL / loadNamespace() Error

2014-05-20 Thread Peter Meissner
Dear Listeners, I finally managed to install RMySQL on my Win7(64Bit) machine with R.3.1.0. Now, as long as I start R manually and load the package everything is working just fine: the package loads and I can connect to a database and query it. But, when NppToR does start the R session for me

[R] Large matrices and pairs/ggpairs

2014-05-20 Thread Tim Richter-Heitmann
Hi there, i recently started to learn R to deal with a huge data matrix to deal with with ecological data (about 40 observations in 360 samples, divided in 7 groups of similar samples). I want to do a simple pairs or ggpairs: pairs(mydata, pch=20, col=brewer.pal(7, Dark2)[unclass(all$group)])

Re: [R] Rprintf not updating

2014-05-20 Thread blosloos
Hi Could not make this example work, maybe because its missing *rPercentComplete pointing at percentComplete. The above mentioned link has been moved? to: https://gist.github.com/KRD1/2503984 however, this worked for me: *R side:* /pBar - txtProgressBar( min = 0, max = 100, style = 3)

Re: [R] Second axis on bottom of graph

2014-05-20 Thread peter dalgaard
On 20 May 2014, at 16:34 , Hurr hill0...@umn.edu wrote: I had asked How can I: 1) make ticks shorter or longer 2) make ticks cross the axis line 3) make ticks project toward the plot 4) make grid lines 5) make perpendicular labels be close to the axis near ticks projecting away from

Re: [R] Documenting docType data

2014-05-20 Thread Witold E Wolski
Thanks a lot. I still had an @export. On 20 May 2014 14:34, Hadley Wickham h.wick...@gmail.com wrote: Don't export the dataset? (as mentioned in the answer to that question). If that doesn't help, please supply a minimal reproducible example. Hadley On Tue, May 20, 2014 at 3:35 AM, Witold

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Knut Krueger
Am 20.05.2014 17:32, schrieb Bert Gunter: paste(a,b,sep=\\) ## \\ is the escaped single backslash [1] a\\b cat(paste(a,b,sep=\\)) a\b Does this help clarify? Or have i misunderstood you? @David and @Bert unfortunately yes. My question is more a system level question as about any

Re: [R] Variation Inflation factor for GLS

2014-05-20 Thread John Fox
Dear Laura, There is no car::vif() method for gls objects, but the approach that car:::vif.lm() uses -- to compute VIFs (and generalized VIFs) from the correlation matrix of the coefficients -- should be applicable to models fit by gls(). I'll take a look a providing a vif.gls() method when I

[R] Subset, period of days like one after another in a group

2014-05-20 Thread Christoph Schlächter
Dear all, I have a subset of a data frame with 3 columns and a few rows. The columns are “date” [%Y %m %d], “mon” [%b] and “wea” for type of weather with “dw” dry weather “rw” rainy weather. Here it is as a list: structure(list(date = structure(c(15765, 15766, 15767,

Re: [R] Subset, period of days like one after another in a group

2014-05-20 Thread arun
Hi, #if 'dat` is the dataset May be this helps. lst1 - setNames(split(dat, cumsum(c(TRUE,diff(dat$date)!=1))),LETTERS[1:4]) A.K. On Tuesday, May 20, 2014 12:17 PM, Christoph Schlächter christoph.schlaech...@gmail.com wrote: Dear all, I have a subset of a data frame with 3 columns and a few

Re: [R] NppToR / RMySQL / loadNamespace() Error

2014-05-20 Thread Brian Ripley
We have no idea what NppToR Is. But as a guess you ran 64-bit R and it ran 32-bit or v.v. Why don't you ask NppToR's help service? The architecture of MySQL must match that of the R under which you installed RMySQL. On 20 May 2014, at 15:08, Peter Meissner peter_...@web.de wrote: Dear

Re: [R] \ escape sequence and windows path

2014-05-20 Thread David L Carlson
Now I understand. Not really a solution, but you can instruct students to use only forward slashes in their paths since R will convert to backslash on Windows systems automatically. After a couple of broken commands, they should get the hang of it. David C -Original Message- From:

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Duncan Murdoch
On 20/05/2014 12:04 PM, Knut Krueger wrote: Am 20.05.2014 17:32, schrieb Bert Gunter: paste(a,b,sep=\\) ## \\ is the escaped single backslash [1] a\\b cat(paste(a,b,sep=\\)) a\b Does this help clarify? Or have i misunderstood you? @David and @Bert unfortunately yes. My question is more

Re: [R] Subset, period of days like one after another in a group

2014-05-20 Thread arun
Hi, In your example the wea, only showed dw.  Suppose the data is like this: dat1 - structure(list(date = structure(c(15765, 15766, 15767, 15768, 15769, 15770, 15771, 15772, 15773, 15780, 15781, 15782, 15788, 15789, 15790, 15791, 15792, 15795, 15796, 15797, 15798, 15799, 15800, 15801,

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Bert Gunter
Duncan: ... If you want to solve the problem I have a pathname in the clipboard, and want to put it in a string, it's not hard to write a function that essentially does readLines(clipboard) Does not the Windows version R function readClipboard() do this already? -- Bert Bert Gunter

Re: [R] dealing with missing values

2014-05-20 Thread arun
Hi, It is better to show the data using ?dput().  It is not clear whether your missing values are read as or NA in the dataset. Also, assuming that the function is from library(ade4) #1st case. NAs dat -  structure(list(X = structure(c(1L, 1L, NA, NA, 2L, 2L), .Label = c(df, rd), class =

Re: [R] \ escape sequence and windows path

2014-05-20 Thread Duncan Murdoch
On 20/05/2014 1:15 PM, Bert Gunter wrote: Duncan: ... If you want to solve the problem I have a pathname in the clipboard, and want to put it in a string, it's not hard to write a function that essentially does readLines(clipboard) Does not the Windows version R function readClipboard() do

Re: [R] Second axis on bottom of graph

2014-05-20 Thread Hurr
I was able to put tck=-0.1 into either par() or axis() and it made a tick difference I understood. As I understand it, default for mgp is c(3,1,0). When I put mgp=c(3,4,0) or mgp=c(3,7,0) into either par() or axis() I see no difference. Hurr -- View this message in context:

Re: [R] dealing with missing values

2014-05-20 Thread arun
Also, if the dataset is `dat1`  model.matrix(~X+Y,data=dat1)[,-1]   Xdf Xrd Yas Yeq 1   1   0   1   0 2   1   0   0   0 3   0   0   1   0 4   0   0   0   1 5   0   1   0   0 6   0   1   0   1 A.K. On Tuesday, May 20, 2014 1:32 PM, arun smartpink...@yahoo.com wrote: Hi, It is better to show

Re: [R] \ escape sequence and windows path

2014-05-20 Thread David L Carlson
That's the solution I was working on. Design the function (the foo() in your example) to read the clipboard so you do not need to paste anything. That greatly reduces how generally the function can be used since it will fail if there is not a path in the clipboard, but it solves (ameliorates?)

Re: [R] Voronoi-Diagrams in R

2014-05-20 Thread Raphael Päbst
Thank you very much, this looks promising. I have a follow-up question however, probably due to my thickness when it comes to the underlying math. I am translating (as closely as possible) some code that has originally been written for Mathlab and uses the delaunay() function there. Now, if I

[R] empty density plot for point pattern in spatstat

2014-05-20 Thread Christopher W Ryan
I'm running R-3.0.3 on Windows XP Professional on an institutional PC. (My freedom to update to a more recent version of R is limited, although I might be able to prevail upon the powers that be, if that would solve the problem.) I installed spatstat via install.packages() and received version

Re: [R] cumulative frequency distribution combined with histogram in one plot at two different scales

2014-05-20 Thread Adams, Jean
Shane, Do you have code to create each plot separately? If so, you can use par(new=TRUE) to overlay a second plot over the first with a different y-axis scale. See, for example, http://robjhyndman.com/hyndsight/r-graph-with-two-y-axes/ Jean On Tue, May 20, 2014 at 8:39 AM, Shane Carey

Re: [R] Voronoi-Diagrams in R

2014-05-20 Thread Boris Steipe
deldir() uses Lee and Schacter's algorithm, while the geometry package is a (partial) implementation of Barber et. al's Quickhull. Since both algorithms are correct, they should give the same results for the same data. How about you post a small input dataset and list the output that you

Re: [R] R save with encoding...

2014-05-20 Thread David Winsemius
On May 19, 2014, at 1:40 PM, Alexsandro Cândido de Oliveira Silva wrote: Hello everybody!! I'm trying to plot a graphic with the title: INTERVALS λ. But the special character λ can't be encoded using ISO8859-1. For future reference the reason this went unanaswered as long as it did

Re: [R] Voronoi-Diagrams in R

2014-05-20 Thread Raphael Päbst
Thanks for the answer! I'll post a sample tomorrow, I have however found the following: triang.list() gives me the coordinates of the triangle's vertices, while delaunayn() gives me the indices of those coordinates. Thus it should be more or less simple to convert the output of deldir() into that

Re: [R] empty density plot for point pattern in spatstat

2014-05-20 Thread Adams, Jean
It works just fine for me ... using R-3.1.0 on Windows 7 and spatstat version 1.37-0. Jean On Tue, May 20, 2014 at 3:31 PM, Christopher W Ryan cr...@binghamton.eduwrote: I'm running R-3.0.3 on Windows XP Professional on an institutional PC. (My freedom to update to a more recent version of R

Re: [R] Second axis on bottom of graph

2014-05-20 Thread peter dalgaard
Hm? Try plot(0, mgp=c(3,2,0), las=2) On 20 May 2014, at 19:41 , Hurr hill0...@umn.edu wrote: I was able to put tck=-0.1 into either par() or axis() and it made a tick difference I understood. As I understand it, default for mgp is c(3,1,0). When I put mgp=c(3,4,0) or mgp=c(3,7,0) into

Re: [R] Voronoi-Diagrams in R

2014-05-20 Thread Rolf Turner
It sounds to me as though you are simply getting yourself flummoxed by the fact that the different packages produce their output in different formats. The information in the output will be the same (as Boris has indicated) --- it will just be arranged differently. Learn to interpret the

Re: [R] cumulative frequency distribution combined with histogram in one plot at two different scales

2014-05-20 Thread arun
Hi, May be you can try ?twoord.plot from library(plotrix) A.K. On Tuesday, May 20, 2014 9:41 AM, Shane Carey careys...@gmail.com wrote: Hi, I amtrying to plot a cfd with a histogram on one plot. The problem is the scale (y-axis) of the plots are hugely different and as a result the histogram

[R] bootstrapping for maxium data

2014-05-20 Thread 张以春
Dear friends, I have a numeric vector composed of 320 numbers. Now, I want to do resample for 1 times. I want to get maxium number for every trial and get a 1 maxium numbers. I have tried to use boot package such as follows.

Re: [R-es] Curvas de densidad no parametricas

2014-05-20 Thread Omar Salas Jácome
Hola a todos podrían ayudarme con lo siguiente. que modelo modelo debo utlizar para correr un modelo garch gjr para poder transcribir estos comandos de matlab a r-project: % spec = garchset('varianceModel','GJR','c',0.027,'ar',[],'ma',-0.073,'k',0.009,...%

[R-es] Popularidad de R

2014-05-20 Thread Marcuzzi, Javier Ruben
¿Donde se encuentra R dentro de la informática? Hoy de casualidad y por otro tema vi un gráfico que podría emplicar esa pregunta. http://langpop.corger.nl/ Javier Marcuzzi ___ R-help-es mailing list R-help-es@r-project.org