Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <vb511c$2ur8c$1@dont-email.me>
Deutsch   English   Français   Italiano  
<vb511c$2ur8c$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk>
Newsgroups: comp.os.vms
Subject: Fun: R on VMS
Date: Mon, 2 Sep 2024 14:43:56 -0400
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <vb511c$2ur8c$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 02 Sep 2024 20:43:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e74d2c4f5929df22ff26da4afad93dec";
	logging-data="3108108"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18nsw68KtftEYJm1YO+8ZcPRPwqvApytw0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:R7XGjrc6IwpSa45gpLKppS2IbyE=
Content-Language: en-US
Bytes: 2689

$ type demo.r
x = rnorm(10, mean=0, sd=1)
print(x)
mx = mean(x)
print(mx)
$ rr demo.r
[1]  0.07825535565335  0.26473517575753  0.24130353303532  0.93891048091823
[5] -0.28034267101425 -1.39355828984642 -0.02804756791571 -0.04600998611413
[9]  -1.7059928439304  0.69180273192578
[1] -0.12389440815307

$ sh symb rr
   RR == "@RR"
$ type rr.com
$ java -cp .:renjin-script-engine-3.5-beta76-jar-with-dependencies.jar 
"RR" 'p1'
$ exit
$ type RR.java
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

import javax.script.ScriptException;

import org.renjin.script.RenjinScriptEngine;

public class RR {
     private static String load(String fnm) throws IOException {
         StringBuilder sb = new StringBuilder();
         BufferedReader br = new BufferedReader(new FileReader(fnm));
         String line;
         while((line = br.readLine()) != null) {
             sb.append(line + "\n");
         }
         br.close();
         return sb.toString();
     }
     public static void main(String[] args) throws IOException, 
ScriptException {
         if(args.length == 1) {
             try {
                 String src = load(args[0]);
                 RenjinScriptEngine eng = new RenjinScriptEngine();
                 eng.eval(src);
             } catch(Exception ex) {
                 ex.printStackTrace();
             }
         } else {
             System.out.println("Usage: rr <r-source-file>");
         }
     }
}

It would obvious be better if Renjin command line worked, but
for some reason it does not work on VMS. So I wrote a little
wrapper reading the file and evaluating using the embedded
Renjin engine.

Arne