Displaying 20 results from an estimated 400 matches similar to: "Using tryCatch in a for loop"
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,
2018 May 22
0
Using tryCatch in a for loop
On 5/22/2018 11:32 AM, Bailey Hewitt wrote:
> Hi Bert,
>
> Thank you for the quick response!
>
> In its current?state?the code?prints three lines that say "warning". What I was expecting is that I would?get?a matrix with 4 columns, 1. column names (from the original data, ex. Lake1) 2. breakpoint year 3. slope 4. slope difference from the first to the?second segment of
2018 May 22
0
Using tryCatch in a for loop
No. If your ouput is a numeric "matrix", it cannot include alpha. Columns
in a data frame can be of different classes, but each column must be single
class.
and finally, of course, see ?cat -- I think you are misusing it. If you
simply want to return "somestuff", your function should be:
function(w) {"somestuff"}
not
function(w) {cat("somestuff")}
As
2018 May 22
4
Using tryCatch in a for loop
Hi Bert,
Thank you for the quick response!?
In its current?state?the code?prints three lines that say "warning". What I was expecting is that I would?get?a matrix with 4 columns, 1. column names (from the original data, ex. Lake1) 2. breakpoint year 3. slope 4. slope difference from the first to the?second segment of the segmented regression. Each row in the matrix would be the results
2018 May 22
0
Using tryCatch in a for loop
Others may have greater insight, but my response is: Exactly what did or
didn't happen that makes you say the code didn't work? That is, what did or
didn't you get when you ran it compared to your expectations?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in
2018 May 22
0
Using tryCatch in a for loop
(practically) ALWAYS respond to the list. I have cc'ed them here.
Others may (almost always do!) have greater insight/better answers than I.
In this case, I have no clue, but presumably your call is wrong, but as I
have no experience with the segmented.lm function, I don't care to track
down how exactly. Your tryCatch call seems to be fine, however.
-- Bert
Bert Gunter
"The
2009 Mar 30
2
ggplot2-geom_text()
Hi: I need help with geom_text().
I would like to count the number of Locations
and put the sum of it right above each bar.
x <- "Location 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
2013 Nov 15
0
getting the results of tapply into a single matrix
Hi,
Try:
example <- read.table(text="ID Sex Location CL
1?? F??? lake1?? 40
1?? F??? lake1???
1?? F??? lake1???? 43
2?? M??? lake1??? 30
3?? M??? lake2??? 22
4?? F??? lake2???? 25
4?? F??? lake2???? 27",sep="",header=TRUE,stringsAsFactors=FALSE,fill=TRUE)
aggregate(CL~.,example,mean,na.rm=TRUE)
#or
library(plyr)
2005 Aug 10
2
Samba3 server tries to sync WINS with itself and fails
I have a Samba 3 server that is trying to sync with itself. I have
wins support = yes in the samba configuration file and there are no
other WINS servers on the network.
The IP address of the Samba server is 192.168.10.4 and is trying to
sync with itself but fails...
Here's the error from log.nmbd
[2005/08/10 12:34:21, 0] nmbd/nmbd_nameregister.c:register_name_response(130)
2017 Nov 13
19
[Bug 103721] New: Frequent freezes with nouveau on Thinkpad P50
https://bugs.freedesktop.org/show_bug.cgi?id=103721
Bug ID: 103721
Summary: Frequent freezes with nouveau on Thinkpad P50
Product: xorg
Version: unspecified
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Driver/nouveau
Assignee: nouveau at
2008 Jan 24
3
Reshaping a dataframe with conditional summary of columns - apply or reshape?
I need to do a somewhat complex rearrangement of an existing dataframe that
involves an "on-the-fly" conditional summary as well. I've tried to make
the example as simple as possible. Code to produce the object being acted
on is at the end of the message. I hope this isn't too much for a single
posting. Any guidance will be much appreciated.
The input example looks like
2007 Aug 30
2
Additions to xyplot (lattice)? - legend, ticks, axis label size, text
I have created an xyplot of a time series with the following code...
win.graph(width = 10, height = 7)
panel1 = function(x, y) {
panel.loess(x, y, lwd=2.5, span=0.5, col="gray")
panel.xyplot(x, y, pch=19, col="blue", cex=1.25)
}
xyplot(oneplusdensity ~ year, data=figdata, aspect="fill", cex=1.5,
xlab=NULL, ylab=expression("Crabs per
2013 Mar 19
1
Error when adding lines to a plot using the mixed-effect model and metafor package
Hi,
I am a student using R for my final year project, with the metafor package being particularly helpful. I have been following the steps laid out in the manual 'Conducting Meta-analysis in R with the Metafor package' (Viechtbauer, 2010) and applying it to my own data of infected Anopheles mosquitoes across Africa.
In particular, I am attempting to apply a mixed-effect model to my data
2010 Apr 08
1
texi2dvi runs but produces no output
I am working on a Windows XP machine with R 2.10.1 and a recent
installation of MiKTeX 2.8. I use LyX (www.lyx.org) to write documents
and have it set up to run Sweave, Stangle, and make the PDF through R
using a batch script and a MakeSweave.R file. This system worked just
fine until I ran some MiKTeX updates yesterday. This is a bit
embarrassing as I helped produce a "How-to" guide to
2009 Apr 01
0
回复: R-help Digest, Vol 73, Issue 32
Dear sir, How to do bilinear time series in R?Is there any functions or packages? thank you!
-----Sincerely yours
Kuangnan Fang 方匡南 敬上
department of statistics ,Economics school,Xia men University.
Fujian Province (361005) China
Mobile Phone:15860721915 SKYPE: ruiqwy
MSN Messenger: ruiqwy@hotmail.com
QQ:39863401
--- 09年3月31日,周二, r-help-request@r-project.org
2004 Sep 05
5
'point-and-print' general questions
I have gotten 'point-and-print' working, but there are a couple small
issues/questions I am trying to get my grasp around:
- rpcclient print-1201 -U root%secret -c 'enumdrivers'
this lists the drivers twice (I saw one other post about this,
without any followup)
- When adding drivers via the Windows APW, after uploading the drivers
and the APW closing - are you supposed to
2007 Oct 18
5
Secondary Y axis title
I have the following R code to create a plot with two y axes. I am
essentially trying to
plot a price series with a volume series on the same graph. (i.e. to
compare price with volume). I can label the first
y axis successfully, but the problem is in labeling the 2nd y-axis.
Essentially, the
label never appears. It seems as though there is not enough margin
on the right hand
side of
2008 May 05
1
[LLVMdev] Wanna contribute to LLVM ..
Respected Sir,
Let me introduce myself,This is Umesh from INDIA who currently working in
Hewitt Packard(HP),Where i work in the Virtual Machine(VM) team from past
one year in the maintianing the Java Virtual Machine(JVM) on Hp-Ux.
I like to contribute to LLVM by utilize my experiences and skills on
compilers and virtual machines.
Me like to take the bug 715 in bugzilla i.e Fix / clean up
2008 Sep 04
1
Samba Group issues - LDAP
Hi all,
Not exactly sure what's the problem here. I use GoSA
(https://gosa.gonicus.de/) to create users in our LDAP system, and
lately when I create new users they don't have any Group associations
in Samba.
I have a bunch of groups in the LDAP tree as well as users. The
server uses libnss_ldap and pam_ldap to access the ldap tree.
If use do getent group then i'll see this...
#
2008 Jun 23
1
Short courses for beginners?
Recently I've had a couple folks ask me whether there are short courses or
tutorials offered to help them get started in R. They're thinking of
small-ish courses that they could travel to (in the US) and spend a few days
focused on the basics of data manipulation and modeling in R. I've seen
announcements now and then on this list, but none recently. Is there a
central place where such