Difference between revisions of "Run GLM demo"

From Age of Water
Jump to: navigation, search
(fleshing out text. will be modifying)
(Installing required packages)
 
(16 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
===Installing required packages===
 
===Installing required packages===
  
'''Lake Analyzer''' <br />
+
For '''windows, OSX, or Linux''' use use the following command in R:
In R, type:  
+
<code><pre> install.packages("glmtools",  
<code><pre> install.packages('rLakeAnalyzer') </pre></code>
+
    repos = c("http://gleon.github.io/", "http://cran.us.r-project.org"),
To use package, type:
+
    dependencies = TRUE,
<code><pre> library(LakeAnalyzer) </pre></code>
+
    type = "both")</pre></code>
see [http://cran.r-project.org/web/packages/rLakeAnalyzer/rLakeAnalyzer.pdf Lake Analyzer pdf] for help
+
  
'''Lake Metabolizer''' <br />
+
You now have GLM (<code>GLMr</code>), R tools for GLM (<code>glmtools</code>), NetCDF file handlers (<code>ncdf</code>), and <code>rLakeAnalyzer</code> installed!!
In R, type:
+
<code><pre> install.packages('LakeMetabolizer') </pre></code>
+
To use package, type:
+
<code><pre> library(LakeMetabolizer) </pre></code>
+
see [http://cran.r-project.org/web/packages/LakeMetabolizer/LakeMetabolizer.pdf Lake Metabolizer pdf] for help
+
  
To see which packages are currently loaded into your R session, type:  
+
If you installed glmtools a while ago, it would be best to update it:
<code><pre> search() </pre></code>  
+
<code><pre> update.packages(repos = "http://gleon.github.io/",
 +
    type = "source")</pre></code>
  
'''GLMtools''' (Not on CRAN) <br />
+
===Run GLM demo===
instructions from [https://github.com/USGS-R/glmtools USGS github]
+
<code><pre>library(GLMr)
 +
demo(glm)</pre></code>
  
''For windows use the following command in R:''
+
If you get a success message, your task is complete!
<code><pre> install.packages("ncdf4",repos = "http://gleon.github.com/",type = "win.binary") </pre></code>
+
 
''then''  
+
===Troubleshooting===
<code><pre> install.packages("glmtools",repos = c("http://gleon.github.com/","http://usgs-r.github.io",
+
Only supported for OSX 10.9 (Mavericks) and newer.
"http://cran.us.r-project.org"), dependencies = TRUE,type = "both",
+
 
INSTALL_opts = "--no-multiarch") </pre></code>
+
Package has been updated, so the following should not arise.
 +
Mac Users: If you get a 'permission denied error' when running demo(glm), you must change the permission setting on the sim folder in terminal.
 +
<br>Example error:
 +
<code><pre> sh: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/GLMr/extbin/macGLM/bin/glm: Permission denied </pre></code>
 +
 
 +
'''Steps'''
 +
* Open TERMINAL
 +
* Change directory folder to that listed in the error. (copy bold text, and change to match your personal file path)
 +
example:  
 +
''MyLovley-MacBook-Pro:~ user$'' '''cd /Library/Frameworks/R.framework/Versions/3.0/Resources/library/GLMr/extbin/macGLM/bin'''
 +
** If you type '''ls''', you should see 10 files, one of which is titled 'glm'
 +
* Type
 +
<code><pre> chmod 755 glm </pre></code>
 +
* You should now be able to run demo(glm)
  
''For OSX or Linux use the following command in R:''
 
<code> <pre>install.packages("glmtools",repos = c('http://gleon.github.com/',"http://usgs-r.github.io",
 
'http://cran.us.r-project.org'), dependencies = TRUE,type = "both")</pre></code>
 
  
 
<!-- Do NOT Edit below this Line -->
 
<!-- Do NOT Edit below this Line -->
 
{{#set:
 
{{#set:
 
Owner=Jordan_Read|
 
Owner=Jordan_Read|
 +
Progress=100|
 
StartDate=2014-10-18|
 
StartDate=2014-10-18|
 
TargetDate=2014-10-24|
 
TargetDate=2014-10-24|
 
Type=Low}}
 
Type=Low}}

Latest revision as of 14:16, 26 October 2014


Installing required packages

For windows, OSX, or Linux use use the following command in R:

 install.packages("glmtools", 
    repos = c("http://gleon.github.io/", "http://cran.us.r-project.org"),
    dependencies = TRUE,
    type = "both")

You now have GLM (GLMr), R tools for GLM (glmtools), NetCDF file handlers (ncdf), and rLakeAnalyzer installed!!

If you installed glmtools a while ago, it would be best to update it:

 update.packages(repos = "http://gleon.github.io/",
    type = "source")

Run GLM demo

library(GLMr)
demo(glm)

If you get a success message, your task is complete!

Troubleshooting

Only supported for OSX 10.9 (Mavericks) and newer.

Package has been updated, so the following should not arise. Mac Users: If you get a 'permission denied error' when running demo(glm), you must change the permission setting on the sim folder in terminal.
Example error:

 sh: /Library/Frameworks/R.framework/Versions/3.0/Resources/library/GLMr/extbin/macGLM/bin/glm: Permission denied 

Steps

  • Open TERMINAL
  • Change directory folder to that listed in the error. (copy bold text, and change to match your personal file path)

example: MyLovley-MacBook-Pro:~ user$ cd /Library/Frameworks/R.framework/Versions/3.0/Resources/library/GLMr/extbin/macGLM/bin

    • If you type ls, you should see 10 files, one of which is titled 'glm'
  • Type
 chmod 755 glm 
  • You should now be able to run demo(glm)


Yandex.Metrica