s-news
[Top] [All Lists]

Re: R "alarm"

To: "Dennis Fisher" <fisher@plessthan.com>, <s-news@lists.biostat.wustl.edu>
Subject: Re: R "alarm"
From: "Garrett, Robert" <garrett@NRCan.gc.ca>
Date: Mon, 7 Jan 2008 17:03:11 -0500
References: <9A848FAF-50AA-4EBB-A404-BE1620C78E26@plessthan.com>
Thread-index: AchRNmcj/i0Csw5ISCeyiJebTr6pWwAQrEZ3
Thread-topic: [S] R "alarm"
I saved the following from S-News back in 2004.  It may do the trick for you:
 
From:  Steve McKinney[SMTP:smckinney@insightful.com]
Sent:  Thursday, January 15, 2004 9:04 PM
To:  Buttrey, Sam USA
Cc:  s-news@lists.biostat.wustl.edu
Subject:  Re: [S] bells and rings
The following function rings a bell on my Windows 2000 PC and should not 
interfere any of your existing S-PLUS objects:

bell <- 
  function(N = 5)
{
  while(exists(bellfile <- paste("bell", sample(9999, 1), sep = ""),
               where = 1)) {}
  on.exit(remove(bellfile))
  assign(bellfile, rep("\007", N), where = 1, immediate = T)
  commandString <-
    paste("dos(\"type .\\\\.Data\\\\",
          bellfile, "\", out = F, min = T )",
          sep = "")
  eval(parse(text = commandString))
  
}

In S-PLUS:
> bell()
# rings 5 times
> bell(2)
# rings twice
 

Hope this helps
Steven McKinney 
Consulting Services 
Insightful Corporation 
  
smckinney@insightful.com <mailto:smckinney@insightful.com> 
  
Views expressed are my own, not Insightful's, etc. 
 
Cheers,
 
        Bob
 
Robert G. (Bob) Garrett                                   Robert G. (Bob) 
Garrett
Emeritus scientist                                                  scientique 
émérite
Geological Survey of Canada          Commission géologique du Canada
Natural Resources Canada                    Ressources naturelles Canada
601 Booth St., Ottawa, Ontario            601 rue Booth, Ottawa (Ontario) 
Canada K1A 0E8                                                     Canada K1A 
0E8
------------------------------------------------------------------------------------------------------
Tel.: 613+995-4517  FAX: 613+996-3726
Email: garrett@NRCan.gc.ca <mailto:garrett@NRCan.gc.ca> 
website: http://gsc.nrcan.gc.ca/dir/index_e.php?id=4961 
<http://gsc.nrcan.gc.ca/dir/index_e.php?id=4961> 
------------------------------------------------------------------------------------------------------

________________________________

From: s-news-owner@lists.biostat.wustl.edu on behalf of Dennis Fisher
Sent: Mon 1/7/2008 9:05 AM
To: s-news@lists.biostat.wustl.edu
Subject: [S] R "alarm"


Colleagues, 

I recently discovered that R permits the user to generate a beep with the 
command alarm() or cat("\a").  I can't find a command comparable to alarm() is 
Splus 8 and cat("\a") yields an error message.  Is there a work-around 
available in S-plus?

Dennis





Dennis Fisher MD

P < (The "P Less Than" Company)

Phone: 1-866-PLessThan (1-866-753-7784)

Fax: 1-415-564-2220

www.PLessThan.com <http://www.plessthan.com/> 



<Prev in Thread] Current Thread [Next in Thread>
  • R "alarm", Dennis Fisher
    • Re: R "alarm", Garrett, Robert <=