search for: lake3

Displaying 9 results from an estimated 9 matches for "lake3".

Did you mean: lake
2009 Mar 30
2
ggplot2-geom_text()
...cation Lake_dens Fish Pred Lake1 1.132 1 0.115 Lake1 0.627 1 0.148 Lake1 1.324 1 0.104 Lake1 1.265 1 0.107 Lake2 1.074 0 0.096 Lake2 0.851 0 0.108 Lake2 1.098 0 0.095 Lake2 0.418 0 0.135 Lake2 1.256 1 0.088 Lake2 0.554 1 0.126 Lake2 1.247 1 0.088 Lake2 0.794 1 0.112 Lake2 0.181 0 0.152 Lake3 1.694 0 0.001 Lake3 1.018 0 0.001 Lake3 2.88 0 0" DF <- read.table(textConnection(x), header = TRUE) p <- ggplot(DF,aes(x=Location)) + geom_bar() p + geom_text(aes(y=Location),label=sum(count)) # Error because count doesn't exist in dataset What should I use instead of 'co...
2018 May 22
2
Using tryCatch in a for loop
Data and code as promised: #Creating a test dataset Year<- c(2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014) Lake1<- c(2, 4, 5, 2, 1, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2) Lake2<- c(1, 3, -1, 4, -2, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2) Lake3<- c(1, 2, 5, -3, 1, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2) Lake4<- c(1, 1, 1, 1, 1, 1, 1, 250, 240, 240, 240, 240, 240, 239, 255) mydata<- data.frame(Year, Lake1, Lake2, Lake3, Lake4) #Running a for loop that indicates when an error or warning occurs y<- mydata[,2:5] year <- mydata$Year regi...
2018 May 22
3
Using tryCatch in a for loop
...ovice when it comes to coding and I am having a hard time getting the code to work properly. Below is the code I have developed thus far (with a test dataset as an example): #Creating a test dataset Year<- c(2000, 2001, 2002, 2003, 2004) Lake1<- c(2, 4, 5, 2, 1) Lake2<- c(1, 3, -1, 4, -2) Lake3<- c(1, 2, 5, -3, 1) mydata<- data.frame(Year, Lake1, Lake2, Lake3) #Running a for loop that indicates when an error or warning occurs y<- mydata[,2:4] year <- mydata$Year regimeshift <- data.frame() for (i in 1:3){ ? tryCatch({ ? ? y.val <- y[,i] ? ? lin.reg <- lm(y.val~year,...
2018 May 22
0
Using tryCatch in a for loop
...d code as promised: > > #Creating a test dataset > Year<- c(2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, > 2011, 2012, 2013, 2014) > Lake1<- c(2, 4, 5, 2, 1, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2) > Lake2<- c(1, 3, -1, 4, -2, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2) > Lake3<- c(1, 2, 5, -3, 1, 1, 2, 3, 4, 5, 6, 2, 3, 1, 2) > Lake4<- c(1, 1, 1, 1, 1, 1, 1, 250, 240, 240, 240, 240, 240, 239, 255) > mydata<- data.frame(Year, Lake1, Lake2, Lake3, Lake4) > > #Running a for loop that indicates when an error or warning occurs > y<- mydata[,2:5] &gt...
2018 May 22
4
Using tryCatch in a for loop
...vice when it comes to coding and I am having a hard time getting the code to work properly. Below is the code I have developed thus far (with a test dataset as an example): #Creating a test dataset Year<- c(2000, 2001, 2002, 2003, 2004) Lake1<- c(2, 4, 5, 2, 1) Lake2<- c(1, 3, -1, 4, -2) Lake3<- c(1, 2, 5, -3, 1) mydata<- data.frame(Year, Lake1, Lake2, Lake3) #Running a for loop that indicates when an error or warning occurs y<- mydata[,2:4] year <- mydata$Year regimeshift <- data.frame() for (i in 1:3){ ? tryCatch({ ? ? y.val <- y[,i] ? ? lin.reg <- lm(y.val~year,...
2018 May 22
0
Using tryCatch in a for loop
...nd I am having a hard time getting the code to work properly. Below is the code I have developed thus far (with a test dataset as an example): > > #Creating a test dataset > Year<- c(2000, 2001, 2002, 2003, 2004) > Lake1<- c(2, 4, 5, 2, 1) > Lake2<- c(1, 3, -1, 4, -2) > Lake3<- c(1, 2, 5, -3, 1) > mydata<- data.frame(Year, Lake1, Lake2, Lake3) > > #Running a for loop that indicates when an error or warning occurs > y<- mydata[,2:4] > year <- mydata$Year > regimeshift <- data.frame() > for (i in 1:3){ > ? tryCatch({ > ? ? y.va...
2018 May 22
0
Using tryCatch in a for loop
...having a hard time getting the code > to work properly. Below is the code I have developed thus far (with a test > dataset as an example): > > #Creating a test dataset > Year<- c(2000, 2001, 2002, 2003, 2004) > Lake1<- c(2, 4, 5, 2, 1) > Lake2<- c(1, 3, -1, 4, -2) > Lake3<- c(1, 2, 5, -3, 1) > mydata<- data.frame(Year, Lake1, Lake2, Lake3) > > #Running a for loop that indicates when an error or warning occurs > y<- mydata[,2:4] > year <- mydata$Year > regimeshift <- data.frame() > for (i in 1:3){ > tryCatch({ > y.val &...
2018 May 22
0
Using tryCatch in a for loop
...having a hard time getting the code > to work properly. Below is the code I have developed thus far (with a test > dataset as an example): > > #Creating a test dataset > Year<- c(2000, 2001, 2002, 2003, 2004) > Lake1<- c(2, 4, 5, 2, 1) > Lake2<- c(1, 3, -1, 4, -2) > Lake3<- c(1, 2, 5, -3, 1) > mydata<- data.frame(Year, Lake1, Lake2, Lake3) > > #Running a for loop that indicates when an error or warning occurs > y<- mydata[,2:4] > year <- mydata$Year > regimeshift <- data.frame() > for (i in 1:3){ > tryCatch({ > y.val &...
2009 Apr 01
0
回复: R-help Digest, Vol 73, Issue 32
...07 Lake2        1.074    0    0.096 Lake2        0.851    0    0.108 Lake2        1.098    0    0.095 Lake2        0.418    0    0.135 Lake2        1.256    1    0.088 Lake2        0.554    1    0.126 Lake2        1.247    1    0.088 Lake2        0.794    1    0.112 Lake2        0.181    0    0.152 Lake3        1.694    0    0.001 Lake3        1.018    0    0.001 Lake3        2.88    0    0" DF <- read.table(textConnection(x), header = TRUE) p <- ggplot(DF,aes(x=Location)) + geom_bar() p + geom_text(aes(y=Location),label=sum(count)) # Error because count doesn't exist in dataset...