Displaying 20 results from an estimated 9000 matches similar to: "how to use conditional statements to handle exceptions?"
2009 Feb 04
2
Capturing all warnings (with messages)
Dear all,
For an open-source project that I'm working on (1), which uses R for
all its heavy lifting but includes a wrapper shell script, I was
hoping to find a way to capture all warnings (and, in fact, errors
too), and handle them in my own way. I realise I can do this for a
single expression using something like:
> f <- function(w) print(w$message)
>
2015 Sep 10
2
Using IDs to suppress specific messages and warnings
Thanks Luke,
On 10 September 2015 at 14:47, <luke-tierney at uiowa.edu> wrote:
> Conditions have classes and the condition system is designed around
> the idea that classes would be used for this sort of thing. That is
> already how tryCatch and withCallingHandlers discriminate the
> conditions to handle.
That makes sense. Though with my sqrt example, it's just a plain
2015 Sep 10
2
Using IDs to suppress specific messages and warnings
The suppressMessages and suppressWarnings functions currently suppress
all the message or warnings that are generated by the input
expression.
The ability to suppress only specific messages or warnings is
sometimes useful, particularly for cases like file import where there
are lots of things that can go wrong.
Suppressing only messages that match a regular expression has rightly
been rejected
2004 Jun 03
2
Force user
Hello list
The Samba Howto Collection repeatedly asserts that by setting the sticky
bit on directories any files created in those directories will be created
with the owner set to that of the directory (for example, see
http://samba.mirror.ac.uk/samba/docs/man/howto/AccessControls.html#id2541262).
This has never worked for me. Files created inherit the group of the
directory, but not the owner.
2010 Dec 05
1
How to catch both warnings and errors?
Dear expeRts,
I am struggling with warning/error handling.
I would like to call a function which can produce either
a) normal output
b) a warning
c) an error
Since the function is called several (thousand) times in a loop, I would like
to proceed "quietly" and collect the warnings and errors [to deal with them at a
later point].
I have seen constructs with tryCatch (which can
2014 Sep 10
1
install.packages misleads about package availability?
In the context of installing a Bioconductor package using our biocLite()
function, install.packages() warns
> install.packages("RUVSeq", repos="http://bioconductor.org/packages/2.14/bioc")
Installing package into '/home/mtmorgan/R/x86_64-unknown-linux-gnu-library/3.1-2.14'
(as 'lib' is unspecified)
Warning message:
package 'RUVSeq' is not available
2004 Mar 09
2
read.table() question
Hi,
In the following code, I got an error meesage if an
input file is empty, and the program stopped running.
Could someone to tell me how to handle this problem. I
want the program to keep running. Thanks.
for i in [1:3]
{
file=paste("file", i, ".dat")
x <- read.data(file)
x(11)
plot(x);
dev.off()
}
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
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
2004 Feb 27
5
How to save images?
After I use function plot() to get an image, how can I
save the image or export it to .gif or other digital
formats?
Thanks a lot.
2004 Jul 14
3
hosting library (ie. PVCS) on Samba
Hello.
I believe that I've done my due diligence in researching what info. is
currently available on this issue.
I have been jacking with this for days, & believe that I have tried all
possible solutions.
I am basically trying to move a [Merant] PVCS installation from an OS/2
file server to a SuSE/Samba file server.
This installation consists of 'standard' source archives,
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,
2006 Sep 15
3
How to catch a parameter that contains a full url
Hi
I need some help!
I have controller that I need to pass a full url (with its own
parametrs) as a parameter, e.g. I want to call my controller with:
/mycontroller/catchurl?url=http://somedomain.com/afile.jsp?param1=xx¶m2=yy
and in action "catchurl" in mycontroller.rb I would like to have
params[:url] to be
"http://somedomain.com/afile.jsp?param1=xx¶m2=yy"
2009 Oct 22
4
[LLVMdev] request for help writing a register allocator
I found the problem! My generated code is spilling correctly but is not
reloading at all. For example, if the original code has the equivalent of
this (where %1024 is a virtual reg):
%1024 = xxx
...
yyy = %1024
and I find no physical register for %1024, then I assign it to physical
register %edi and to a stackslot. That creates code like this:
%edi = xxx
store from %edi to the
2001 Dec 11
2
printing from unix to NT printer
Setup:
samba 2.2.2
Solaris 8
Trying to print to a printer attached to an NT4/sp6a machine. Printer passes 'test print page' test on NT and is shared.
Problem:
An error occurs when the smbclient command is used:
cat afile | smbclient \\\\tech223\\testprn -U username%password -P -c "translate;print -"
The error reported is "ERRDOS - ERRbadaccess (Invalid open mode.)
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
2009 Oct 22
0
[LLVMdev] request for help writing a register allocator
Hi Susan,
> But this doesn't seem to be happening; the stores to memory are there but
> the loads are not.
>
> Any ideas what's going wrong?
Are you using VirtRegMap::addSpillPoint and VirtRegMap::addRestorePoint ? If
not you may need to add calls to them to let the rewriter know where to
insert the loads/stores.
> If not, any advice on how to generate the loads
2018 May 22
3
Using tryCatch in a for loop
Hello All,
I have been trying to use a for loop to run segmented regressions (from?R package segmented)?on many columns of data in a data frame with the end goal of writing a new file with the following columns: column title, breakpoint year, slope, and difference in slope. Unfortunately, when one of the columns doesn't have a breakpoint the code stops and provides?an error or warning. I
2005 Apr 12
2
FXSettings problem
Hi all.
I tried to subclass FXSettings in order to add some functionality to it
but I ran into the following problem.
The code which shall be executed looks like this:
def test
reg = Registry.new("test.reg")
reg.Parse
end
The Registry class basically looks this way:
require "fox12"
include Fox
class Registry < FXSettings
2016 Apr 20
2
Data reshaping with conditions
Dear All,
I am trying to reshape the data with some conditions. A small part of the
data looks like below. Like this there will be more data with repeating ID.
Count id name type
117 335 sally A
19 335 sally A
167 335 sally B
18 340 susan A
56 340 susan A
22 340 susan B
53 340 susan B
135 351 lee A
114 351 lee A
84 351 lee A
80 351 lee A
19 351 lee A
8 351 lee A
21 351 lee A
88 351 lee B
111 351