-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathR.html
127 lines (90 loc) · 4.12 KB
/
R.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="psg.css" type="text/css">
<LINK REL="SHORTCUT ICON" HREF="favicon.ico" type="image/x-icon"/>
<META NAME="description" content="System Administrator Pocket Survival Guide - A series of notes for Sys Admin"/>
<META NAME="keyword" content="Sys Admin, System Administrator, Solaris, HP-UX, AIX, Linux, Note, Notes, Pocket, Survival, Guide, psg, data center, power, electrical, plug, LYS, LKS, LAPPLAPP, PSG101, sn50, tin6150"/>
<META NAME="Robots" CONTENT="all"/>
<META NAME="Author" CONTENT="Tin Ho"/>
<title>Pocket Survival Guide - OS</title>
</head>
<body>
<div class="navheader">
<table summary="Navigation header" width="100%">
<tbody>
<tr>
<th colspan="9" align="center">
<A HREF="http://tin6150.github.io/psg/">Sys Admin Pocket Survival Guide - OS</A>
</th>
</tr>
<tr>
<td align="left"> <a accesskey="h" href="psg.html">Home</a> </td>
<td align="center"><a accesskey="s" href="sol.html">Solaris</a> </td>
<td align="center"><a accesskey="p" href="hpux.html">HP-UX</a> </td>
<td align="center"><a accesskey="a" href="aix.html">AIX</a> </td>
<td align="center"><a accesskey="n" href="netapp.html">NetApp</a> </td>
<td align="center"><a accesskey="e" href="emcCelerra.html">EMC(NAS)</a> </td>
<td align="center"><a accesskey="E" href="emc.html">EMC(SAN)</a> </td>
<td align="center"><a accesskey="v" href="veritas.html">Veritas</a> </td>
<td align="right"> <a accesskey="l" href="ldap.html">LDAP</a> </td>
</tr>
</tbody>
</table>
<hr></div>
<div class="chapter" lang="en">
<div class="titlepage">
</div>
</div>
<H1>R</H1>
<H2>Environment</H2>
<PRE>
setenv R_LIBS /path/to/user/R-libraries
# setting R_LIBS will change both where R looks for lib to load and when installing libs
library( rJava ); # see if it can load the R library named rJava (case sensitive)
</PRE>
<H2>Oracle connection</H2>
<PRE>
Sys.setenv(TNS_ADMIN="/site/conf/TNS_ADMIN",ORACLE_HOME="/usr/prog/oracle-client/11.1.0.6",ORACLE_SID='')
# The TNS_ADMIN may not matter if ORACLE_HOME has a network/admin with working conf for tns name resolution.
# ORACLE_SID is very important! if set, the instance specifier in the dbConnect will be ignored, and db always connect to instance specified by ORACLE_SID !!
library( 'ROracle' )
ora=Oracle()
con=dbConnect(ora,user='user/pass@instance')
summary(con)
# verify connected to desired db)
result=dbGetQuery(con, "select * from tab")
# perform SQL query
result
# see result of query (display content of variable)
result2=dbListTables( con )
# see list of tables for the connected schema
# = is likely std var assign
# <- is probably some sort of pointer assignment, pass by object reference kind of stuff ??
</PRE>
<BR><HR><BR>
<BR>
<BR>
<BR>
<BR><HR>
<div align="CENTER">
[Doc URL: <A HREF="http://tin6150.github.io/psg/">
http://tin6150.github.io/psg/
</A>] <BR>
Last Updated: 2008-03-22
<!--[Doc URL: <A HREF="http://psg.ask-margo.com/">http://psg.ask-margo.com/</A>] <BR>-->
<BR>
(cc) Tin Ho. See
<A HREF=psg.html#cc>main page</A>
for copyright info. <BR>
<HR>
<A HREF="http://www.taos.com"><IMG SRC="banner/taos_banner1.gif" width="728" height="98"></A>
</div>
<div class="sig"><BR>
psg101 sn50 tin6150<BR>
hoti1<BR>
bofh1</div>
</body>
<!-- Google analytics new tracking code ga.js. Will actually need to add this code to every page for full tracking! (still the case in 2011?) Using my gmail login 2011.0617 updated with code for http://tin6150.github.io/psg/psg.html --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-4515095-4']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>
</html>