[R-sig-eco] R graphics cookbook
Hi everyone, I am trying to apply the following lines of coding (they are from the R Graphics Cookbook, Chapter 3: Bar Graphs): ggplot(data, aes(x=year_bis,y=area)) + geom_bar(stat=identity) I do have a data.frame as follow: id year start_day locarea 1 1 2010 155 20 3.4388 2 1 2010 169 18 11.6576 3 1 2010 183 17 15.5893 4 1 201071 41 22.0356 5 1 2010 127 42 27.2602 6 1 201099 37 52.2779 str(data)'data.frame':221 obs. of 5 variables: $ id : int 1 1 1 1 1 1 1 1 1 1 ... $ year : int 2010 2010 2010 2010 2010 2010 2008 2010 2009 2010 ... $ start_day: int 155 169 183 71 127 99 337 1 337 113 ... $ loc : int 20 18 17 41 42 37 10 36 41 40 ... $ area : num 3.44 11.66 15.59 22.04 27.26 ... I called both packages gcookbook and ggplot2 (among others). That's a rather easy line of coding, but for some reasons I do have the following warning message: Error in as.environment(x) : incorrect objet for 'as.environment' Do you have any clue why? Thanks a lot. Greetings. -- Dylann Kersusan Master Biodiversity and Conservation Zoology dept. Stockholm University -- Grimsö Wildlife Research Center Ecology dept. SLU Riddarhyttan-Sweden [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] R graphics cookbook
I see `area` in your data.frame, but where's `year_bis`? Cheers, Roman On Mon, Sep 23, 2013 at 9:36 AM, Dylann Kersusan kersusan.dyl...@gmail.comwrote: Hi everyone, I am trying to apply the following lines of coding (they are from the R Graphics Cookbook, Chapter 3: Bar Graphs): ggplot(data, aes(x=year_bis,y=area)) + geom_bar(stat=identity) I do have a data.frame as follow: id year start_day locarea 1 1 2010 155 20 3.4388 2 1 2010 169 18 11.6576 3 1 2010 183 17 15.5893 4 1 201071 41 22.0356 5 1 2010 127 42 27.2602 6 1 201099 37 52.2779 str(data)'data.frame':221 obs. of 5 variables: $ id : int 1 1 1 1 1 1 1 1 1 1 ... $ year : int 2010 2010 2010 2010 2010 2010 2008 2010 2009 2010 ... $ start_day: int 155 169 183 71 127 99 337 1 337 113 ... $ loc : int 20 18 17 41 42 37 10 36 41 40 ... $ area : num 3.44 11.66 15.59 22.04 27.26 ... I called both packages gcookbook and ggplot2 (among others). That's a rather easy line of coding, but for some reasons I do have the following warning message: Error in as.environment(x) : incorrect objet for 'as.environment' Do you have any clue why? Thanks a lot. Greetings. -- Dylann Kersusan Master Biodiversity and Conservation Zoology dept. Stockholm University -- Grimsö Wildlife Research Center Ecology dept. SLU Riddarhyttan-Sweden [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- In God we trust, all others bring data. [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] fish density in GLMM - experimental design problem
Dear list I'm trying to model the relationship between prey capture success by fish (binomial variable, 0/1) and fish length (continuous), fish density (2,4 and 6 individuals) and water velocity (8, 12 and 26cm/2) using GLMM with fish.id as a random effect. Capture success was collected during trials that consisted in sending a prey every 2 min, which could be captured or not by individual fish. A total of 20 prey was sent in each trial independently of fish density, therefore the probability of capture is higher in 2 fish trials than in 4 fish trials and any effect of density would be because of the experimental design! Do you know of any way I could incorporate this information in my models? Model1-glmer(capture~ length + density+ velocity + (1|fish.id.),family=binomial,data=cap) Thanks in advance Best regards, Joana Martelo [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Re: [R-sig-eco] fish density in GLMM - experimental design problem
On Mon, Sep 23, 2013 at 8:11 AM, joana martelo jmmart...@fc.ul.pt wrote: Dear list I'm trying to model the relationship between prey capture success by fish (binomial variable, 0/1) and fish length (continuous), fish density (2,4 and 6 individuals) and water velocity (8, 12 and 26cm/2) using GLMM with fish.id as a random effect. Capture success was collected during trials that consisted in sending a prey every 2 min, which could be captured or not by individual fish. A total of 20 prey was sent in each trial independently of fish density, therefore the probability of capture is higher in 2 fish trials than in 4 fish trials and any effect of density would be because of the experimental design! So you have an experiment which measures how competition among individuals affects per-individual capture probability... what are you trying to measure? It's hard to say anything useful when we don't know that. Do you know of any way I could incorporate this information in my models? Model1-glmer(capture~ length + density+ velocity + (1|fish.id.),family=binomial,data=cap) Thanks in advance Best regards, Joana Martelo [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology -- Krzysztof Sakrejda Organismic and Evolutionary Biology University of Massachusetts, Amherst 319 Morrill Science Center South 611 N. Pleasant Street Amherst, MA 01003 work #: 413-325-6555 email: sakre...@cns.umass.edu ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] R graphics cookbook
Hello, you've probably already figured it out, but the error is because you are telling ggplot to use an x variable which doesn't exist: ggplot(data, aes(x=year_bis,y=area)) + geom_bar(stat=identity year_bis is not a column in the data frame you show us, if you change it to: ggplot(data, aes(x=year,y=area)) + geom_bar(stat=identity) it should work. Date: Mon, 23 Sep 2013 09:36:09 +0200 From: Dylann Kersusan kersusan.dyl...@gmail.com To: r-sig-ecology@r-project.org Subject: [R-sig-eco] R graphics cookbook Message-ID: CAEcqiB9vGNNO=s_xTer=xsWaqAsw= ctbhqgsxd2esmevzaj...@mail.gmail.com Content-Type: text/plain Hi everyone, I am trying to apply the following lines of coding (they are from the R Graphics Cookbook, Chapter 3: Bar Graphs): ggplot(data, aes(x=year_bis,y=area)) + geom_bar(stat=identity) I do have a data.frame as follow: id year start_day locarea 1 1 2010 155 20 3.4388 2 1 2010 169 18 11.6576 3 1 2010 183 17 15.5893 4 1 201071 41 22.0356 5 1 2010 127 42 27.2602 6 1 201099 37 52.2779 str(data)'data.frame':221 obs. of 5 variables: $ id : int 1 1 1 1 1 1 1 1 1 1 ... $ year : int 2010 2010 2010 2010 2010 2010 2008 2010 2009 2010 ... $ start_day: int 155 169 183 71 127 99 337 1 337 113 ... $ loc : int 20 18 17 41 42 37 10 36 41 40 ... $ area : num 3.44 11.66 15.59 22.04 27.26 ... I called both packages gcookbook and ggplot2 (among others). That's a rather easy line of coding, but for some reasons I do have the following warning message: Error in as.environment(x) : incorrect objet for 'as.environment' Do you have any clue why? Thanks a lot. Greetings. -- Dylann Kersusan Master Biodiversity and Conservation Zoology dept. Stockholm University -- Grimsö Wildlife Research Center Ecology dept. SLU Riddarhyttan-Sweden [[alternative HTML version deleted]] -- ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology End of R-sig-ecology Digest, Vol 66, Issue 11 * -- * ___ Jeremy M. Chacon, Ph.D.* * * *Post-Doctoral Associate, Gardner Lab* *University of Minnesota* *Genetics, Cell Biology, and Development* *6-160 Jackson Hall* *321 Church St. SE* *Minneapolis, MN 55455* *USA* * * *chaco...@umn.edu* *Lab telephone: **612-626-6906* [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
[R-sig-eco] convergence problems for zero-inflated model
Hi all! I'm using a zero-inflated model using the function 'zeroinfl' and running into convergence problems (system is computationally singular). How can I modify the code so it does not calculate a Hessian matrix? Thanks, Laura E-mail correspondence to and from this address is subject to the North Carolina Public Records Law and may be disclosed to third parties unless the context is exempt by statute or other regulation. [[alternative HTML version deleted]] ___ R-sig-ecology mailing list R-sig-ecology@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology