[R] block kriging the entire area

2017-05-11 Thread M. Rajib Hassan Mozumder via R-help
Hi Edzer- Is it possible to block krige the entire area with "TransGaussian Kriging Using Box-Cox Transforms” (i.e. krigeTg)? Also, I have seen in the argument section: “block: does not function correctly, afaik” for krigeTg. But when I used the “block” argument it gave me reliable results for

Re: [R] How to plot a legend centered only on the x axis

2017-05-11 Thread Marc Schwartz
> On May 11, 2017, at 7:01 PM, Duncan Murdoch wrote: > > On 11/05/2017 2:36 PM, Antonio Silva wrote: >> Hello r-users >> >> I want to plot some barplots inside a looping with the legend placed >> outside the plotting area. >> >> No matter the number of bars I want

Re: [R] Matched Items in rows + issue with writing a table

2017-05-11 Thread Jim Lemon
Hi abo, I think you want to split your strings and do your matching like this: x444<-read.table(text="w r cyp3,cyp7 cyp2,cyp1,cyp3 cyp2 cyp2 c1,c3,c6 c6,c8,c5", header=TRUE,stringsAsFactors=FALSE) findMatches<-function(x,sep=",") { matchval<-NA x1bits<-unlist(strsplit(x[1],sep))

Re: [R] Design matrix for species mixture

2017-05-11 Thread Jim Lemon
Hi Margot, I'm not sure I understand your model, but if I make up some data in which the response variable is vegetation cover and the three species are: A - eats one type of plant B - eats another type of plant C - preys on herbivorous insects df<-read.table(text="field,propveg,A,B,C 1,1,0,0,1

Re: [R] How to plot a legend centered only on the x axis

2017-05-11 Thread Duncan Murdoch
On 11/05/2017 2:36 PM, Antonio Silva wrote: Hello r-users I want to plot some barplots inside a looping with the legend placed outside the plotting area. No matter the number of bars I want the legend to be placed centered on the x-axis. See the example below for(i in 1:10) { var_1 <-

Re: [R] How to plot a legend centered only on the x axis

2017-05-11 Thread Jim Lemon
Hi Antonio, First you want the center of the plot: xylim<-par("usr") x_center<-sum(xylim[1:2])/2 Then as you want to have you legend above the plot: # you will probably want to change the "20" to your preference y_bottom<-xylim[4]+diff(xylim[3:4])/20 then:

Re: [R] How to plot a legend centered only on the x axis

2017-05-11 Thread Antonio Silva
Thanks for you attention Mark. Your approach is really very interesting. I will try to apply it in my code. All the best Antonio 2017-05-11 16:19 GMT-03:00 Marc Schwartz : > > > On May 11, 2017, at 1:36 PM, Antonio Silva > wrote: > > > > Hello

[R] Matched Items in rows + issue with writing a table

2017-05-11 Thread abo dalash
Hi All .., I have a table called "x444" and I would like to create a new column contains the matched items in each row between column w & r . I used match()function as below but this does not return the results I want because of 2 issues. The 1st one is that this gives the row number of

Re: [R] Error: invalid type (closure) for the variable 'time' - object specific trend

2017-05-11 Thread David L Carlson
What Rui said, but as important, you have four columns in your data called "town", "year", "revenue", and "supply". You do not have a column called "time". - David L Carlson Department of Anthropology Texas A University College Station, TX 77840-4352

Re: [R] Error: invalid type (closure) for the variable 'time' - object specific trend

2017-05-11 Thread Rui Barradas
Hello, A closure is, like you say, a function. At an R prompt try: > typeof(time) [1] "closure" So like Duncan suggested rename 'time', for instance capitalize it 'Time'. That should do it. Hope this helps, Rui Barradas Em 11-05-2017 21:20, Tobias Christoph escreveu: Hey Duncan, thank

Re: [R] Error: invalid type (closure) for the variable 'time' - object specific trend

2017-05-11 Thread Tobias Christoph
Hey Duncan, thank you very much for your quick reply. _My data used:_ 1st column(town):1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,...,11 2nd column(year):1,2,3,4,5,6,7,8,9,10,11,12,1,2,3...,12 3rd column (revenue): 4th colum (supply): I have now renamed my colums and did the regression

Re: [R] How to plot a legend centered only on the x axis

2017-05-11 Thread Marc Schwartz
> On May 11, 2017, at 1:36 PM, Antonio Silva wrote: > > Hello r-users > > I want to plot some barplots inside a looping with the legend placed > outside the plotting area. > > No matter the number of bars I want the legend to be placed centered on the > x-axis. > > See

[R] How to plot a legend centered only on the x axis

2017-05-11 Thread Antonio Silva
Hello r-users I want to plot some barplots inside a looping with the legend placed outside the plotting area. No matter the number of bars I want the legend to be placed centered on the x-axis. See the example below for(i in 1:10) { var_1 <- sample(1000:10,sample(3:8,1)) ymax <- max(var_1)

Re: [R] Off-Topic: Project Organisation

2017-05-11 Thread David Winsemius
> On May 11, 2017, at 9:33 AM, g.maub...@gmx.de wrote: > > Hi All, > > this post is somewhat off-topic cause it deals with a meta issue related to > project organisation instead of real R code. > > I have updated my blog concerning a possible directory and file structure for > marketing

[R] Off-Topic: Project Organisation

2017-05-11 Thread G . Maubach
Hi All, this post is somewhat off-topic cause it deals with a meta issue related to project organisation instead of real R code. I have updated my blog concerning a possible directory and file structure for marketing research projects and data mining projects alike:

Re: [R] Error: invalid type (closure) for the variable 'time' - object specific trend

2017-05-11 Thread Duncan Murdoch
On 11/05/2017 9:37 AM, Tobias Christoph wrote: Hey, I just have trouble adding a object specific time trend with the plm-package. I recieve the following error: * **"Error in model.frame.default(terms(formula, lhs = lhs, rhs = rhs, data = data, : invalid type for the variable 'time' "* I used

[R] Design matrix for species mixture

2017-05-11 Thread Margot Neyret
Hello, I have fields with species mixtures (for instance, species a, b, c, a+b, a+c, b+c), and I look at the effect of each species on a response Y. More specifically, I would like to compare the effect of individual species, either alone or in mixture. >Y = rnorm(18,0,1) >mixture=

[R] Error: invalid type (closure) for the variable 'time' - object specific trend

2017-05-11 Thread Tobias Christoph
Hey, I just have trouble adding a object specific time trend with the plm-package. I recieve the following error: * **"Error in model.frame.default(terms(formula, lhs = lhs, rhs = rhs, data = data, : invalid type for the variable 'time' "* I used the formula: / FE_trend<- plm(log(revenue) ~

Re: [R] functions similar to glm

2017-05-11 Thread BR_email
Bert: My question implies that I read (consulted) the reference, as I cited actual wordings of the reference. Apparently, you think I am lazy, and dumb, and like to waste R-helpers' time, as well as mine. Thanks for your reply, quite helpful. Bruce ~~ Bert

Re: [R] functions similar to glm

2017-05-11 Thread Bruce Ratner PhD
Dear David: Thank you for your excellent reply. Apparently, you are a in the know. Again, thanks. Bruce __ Bruce Ratner PhD The Significant Statistician™ (516) 791-3544 Statistical Predictive Analytics -- www.DMSTAT1.com Machine-Learning Data Mining -- www.GenIQ.net > On May 11,

Re: [R] functions similar to glm

2017-05-11 Thread David Winsemius
> On May 11, 2017, at 6:31 AM, Bruce Ratner PhD wrote: > > Bert: > Not clear to me. > Where mentioned are the functions similar to glm, if you please? The basis for the similarity was stated as having an available link function (and I suspected, an inverse as well.) I, for

Re: [R] functions similar to glm

2017-05-11 Thread Bruce Ratner PhD
Bert: Not clear to me. Where mentioned are the functions similar to glm, if you please? Bruce __ > On May 11, 2017, at 8:39 AM, Bert Gunter wrote: > > ?glmulti seems clear enough to me. If not, pls check the reference given > therein. > > Bert > >> On

Re: [R] functions similar to glm

2017-05-11 Thread Bert Gunter
?glmulti seems clear enough to me. If not, pls check the reference given therein. Bert On May 11, 2017 5:22 AM, "BR_email" wrote: > Thanks, Bert. I would expect the list to include, at least lm. The > reference states, "See Examples section." > But, there is nothing in that

Re: [R] functions similar to glm

2017-05-11 Thread BR_email
Thanks, Bert. I would expect the list to include, at least lm. The reference states, "See Examples section." But, there is nothing in that section or elsewhere!! Bruce Bert Gunter wrote: Probably? : All functions for which a link function of the response is modeled as a linear predictor of

Re: [R] [FORGED] creating a color gradient in geom_ribbon

2017-05-11 Thread Paul Murrell
Hi If the ribbon has constant "height" then this can be hacked by drawing a bunch of ribbons (polygons) with different heights and slowly changing colours. If the height of the ribbon varies, then you could use the same approach and clip the result, with a little bit more work. The

[R] functions similar to glm

2017-05-11 Thread Bruce Ratner PhD
R-helpers: In the "glmulti" package, it states parameter fitfunction assumes functions similar to glm, but doesn't list them. What are the functions similar to glm that can be used with glmulti? Bruce __ R-help@r-project.org mailing list -- To

Re: [R] qqplot for binomial distribution

2017-05-11 Thread Ashim Kapoor
Dear All, when I do : set.seed(123) expected_distribution<-rbinom(1000,100,.05) #Without jitter qqplot(jitter(expected_distribution),count1_vector, xlab="Expected distribution",ylab="Observed values") qqline(count1_vector,distribution = function(probs) { qbinom(probs, size=100, prob=0.05)

Re: [R] Solve system of non linear equations using nasted loops

2017-05-11 Thread Berend Hasselman
Your code looks needlessly complicated and inefficient in my view. Even if you don't need or use nested for loops it can still be simplified. 1: First define some new constants to avoid the the M? stuff in your function pME <- ME[2:9]/ME[1] pMI <- MI[2:9]/MI[1] pMA <- MA[2:9]/MA[1] pMAE <-