[R] Defining and running a simple function

From: Thomas L Jones <DrJones_at_alum.MIT.edu>
Date: Thu 02 Feb 2006 - 17:56:52 EST

I am trying, with extremely limited success, to get the R software to do some simple computations. Specifically, I defined a test function as follows:

fn <- function () {

hw <- "hello world"


s <- seq (0, 0.98, 0.02)



The output should just be the words "hello world," followed by a sequence going from 0 to 0.98.

However, when I call the little test function:

fn ()

the words "hello world" get lost and do not come out. Instead, the output begins with

[1] 0.00 0.02, etc

However, when I write a test function for just the words "hello world," the words come out just fine.

Here is the setup:

R-2.2.0 using the English language and the console Windows XP Home Edition Service Pack 2
AVG Antivirus Free Version
Windows built-in firewall
The R buffered output is disabled.
Mozilla Firefox 1.5
Administrator privileges are enabled.

Your advice?

Tom Jones

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Feb 02 18:08:50 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:16 EST