Actuarial Outpost
 
Go Back   Actuarial Outpost > Exams - Please Limit Discussion to Exam-Related Topics > SoA/CAS Preliminary Exams > Exam PA: Predictive Analytics
FlashChat Actuarial Discussion Preliminary Exams CAS/SOA Exams Cyberchat Around the World Suggestions

DW Simpson Global Actuarial & Analytics Recruitment
Download our 2017 Actuarial Salary Survey
now with state-by-state salary information!


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-20-2018, 11:50 PM
kittysnight kittysnight is offline
CAS SOA
 
Join Date: Feb 2017
Location: Boston
Studying for PA
College: University of Connecticut
Posts: 7
Default Setting up and Installing Package into RStudio

Hi everyone,

I am new to R, to be honest. I am going through module 1, and trying to set up my RStudio. I had trouble to install that 'checkpoint' package... Can anyone help me with this???

I am so confused. Where should I save this package? And I cannot run that 2 R chunks either...

Thanks a lot!!!!
__________________
P FM MFE MLC C
APA VEE Finance Statistics Economics
FAP Module 1 2 3 4 5 IA 6 7 8 FA
Reply With Quote
  #2  
Old 09-21-2018, 12:51 AM
Marcie's Avatar
Marcie Marcie is offline
Member
CAS
 
Join Date: Feb 2015
Posts: 8,976
Default

Quote:
Originally Posted by kittysnight View Post
Hi everyone,

I am new to R, to be honest. I am going through module 1, and trying to set up my RStudio. I had trouble to install that 'checkpoint' package... Can anyone help me with this???

I am so confused. Where should I save this package? And I cannot run that 2 R chunks either...

Thanks a lot!!!!
I don't know what module 1 is, or what the 2 R chunks are, but to install the 'checkpoint' package you can use the command
Code:
install.packages('checkpoint')
(There are additional optional arguments you could use with this function.)

When you try running R code, are you getting error or warning messages? If you share those it might be easier to troubleshoot.
Reply With Quote
  #3  
Old 09-21-2018, 10:29 AM
nonactuarialactuary nonactuarialactuary is offline
Member
Non-Actuary
 
Join Date: May 2008
Posts: 2,028
Default

install.packages() will sometimes fail if you don't have administrator rights to your computer, as is often the case in corporate IT settings. If this is happening to you, you'll need to specify an alternative directory for package installation. Post the error messages you get.
Reply With Quote
  #4  
Old 09-22-2018, 12:16 AM
kittysnight kittysnight is offline
CAS SOA
 
Join Date: Feb 2017
Location: Boston
Studying for PA
College: University of Connecticut
Posts: 7
Default

Quote:
Originally Posted by Marcie View Post
I don't know what module 1 is, or what the 2 R chunks are, but to install the 'checkpoint' package you can use the command
Code:
install.packages('checkpoint')
(There are additional optional arguments you could use with this function.)

When you try running R code, are you getting error or warning messages? If you share those it might be easier to troubleshoot.
Thank you so much for replying! Module 1 is the first module of the e-learning modules that SOA provides.

Here is the message it shows after I ran install.packages("checkpoint"). It says there is no package called 'checkpoint'.. I am really confused..

> install.packages("checkpoint")
Installing package into ‘C:/Users/yzton/OneDrive/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
checkpoint 0.4.2 0.4.5 FALSE

installing the source package ‘checkpoint’

trying URL 'https://cran.rstudio.com/src/contrib/checkpoint_0.4.5.tar.gz'
Content type 'application/x-gzip' length 163858 bytes (160 KB)
downloaded 160 KB

Error in library(checkpoint) : there is no package called 'checkpoint'
Execution halted
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\yzton\OneDrive\Documents\R\win-library\3.3" C:\Users\yzton\AppData\Local\Temp\Rtmps9btAr/downloaded_packages/checkpoint_0.4.5.tar.gz' had status 1
Warning in install.packages :
installation of package ‘checkpoint’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\yzton\AppData\Local\Temp\Rtmps9btAr\down loaded_packages’
__________________
P FM MFE MLC C
APA VEE Finance Statistics Economics
FAP Module 1 2 3 4 5 IA 6 7 8 FA
Reply With Quote
  #5  
Old 09-22-2018, 12:17 AM
kittysnight kittysnight is offline
CAS SOA
 
Join Date: Feb 2017
Location: Boston
Studying for PA
College: University of Connecticut
Posts: 7
Default

Quote:
Originally Posted by nonactuarialactuary View Post
install.packages() will sometimes fail if you don't have administrator rights to your computer, as is often the case in corporate IT settings. If this is happening to you, you'll need to specify an alternative directory for package installation. Post the error messages you get.
Thank you so much for replying! I am using my own laptop so I think there should not be administrator issue?

Here is the message it shows after I ran install.packages("checkpoint"). It says there is no package called 'checkpoint'.. I am really confused..

> install.packages("checkpoint")
Installing package into ‘C:/Users/yzton/OneDrive/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
checkpoint 0.4.2 0.4.5 FALSE

installing the source package ‘checkpoint’

trying URL 'https://cran.rstudio.com/src/contrib/checkpoint_0.4.5.tar.gz'
Content type 'application/x-gzip' length 163858 bytes (160 KB)
downloaded 160 KB

Error in library(checkpoint) : there is no package called 'checkpoint'
Execution halted
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\yzton\OneDrive\Documents\R\win-library\3.3" C:\Users\yzton\AppData\Local\Temp\Rtmps9btAr/downloaded_packages/checkpoint_0.4.5.tar.gz' had status 1
Warning in install.packages :
installation of package ‘checkpoint’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\yzton\AppData\Local\Temp\Rtmps9btAr\down loaded_packages’
__________________
P FM MFE MLC C
APA VEE Finance Statistics Economics
FAP Module 1 2 3 4 5 IA 6 7 8 FA
Reply With Quote
  #6  
Old 09-22-2018, 09:12 AM
Marcie's Avatar
Marcie Marcie is offline
Member
CAS
 
Join Date: Feb 2015
Posts: 8,976
Default

I'm also confused because just above that error message it says there are two versions of checkpoint out there on your CRAN mirror.

The only thing I can think of right now is to specify that you want the windows binary version:
Code:
install.packages(pkgs='checkpoint', type='binary')
Maybe try that and let us know how that goes?
Reply With Quote
  #7  
Old 09-22-2018, 09:22 AM
kittysnight kittysnight is offline
CAS SOA
 
Join Date: Feb 2017
Location: Boston
Studying for PA
College: University of Connecticut
Posts: 7
Default

Quote:
Originally Posted by Marcie View Post
I'm also confused because just above that error message it says there are two versions of checkpoint out there on your CRAN mirror.

The only thing I can think of right now is to specify that you want the windows binary version:
Code:
install.packages(pkgs='checkpoint', type='binary')
Maybe try that and let us know how that goes?
This works! Thank you so much!

I am just curious. Could you explain a little more? Where does it say it has two versions? Why do we want windows binary version? What is the other version by the way?
__________________
P FM MFE MLC C
APA VEE Finance Statistics Economics
FAP Module 1 2 3 4 5 IA 6 7 8 FA
Reply With Quote
  #8  
Old 09-22-2018, 01:56 PM
Marcie's Avatar
Marcie Marcie is offline
Member
CAS
 
Join Date: Feb 2015
Posts: 8,976
Default

Quote:
Originally Posted by kittysnight View Post
This works! Thank you so much!

I am just curious. Could you explain a little more? Where does it say it has two versions? Why do we want windows binary version? What is the other version by the way?
Okay, you're going to get my really non-technical explanation of this. Maybe someone who understands this stuff better can chime in.

The bold below is where it told you there were two versions, as well as which one it attempted to install:

Quote:
Originally Posted by kittysnight View Post

> install.packages("checkpoint")
Installing package into ‘C:/Users/yzton/OneDrive/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
checkpoint 0.4.2 0.4.5 FALSE

installing the source package ‘checkpoint’


trying URL 'https://cran.rstudio.com/src/contrib/checkpoint_0.4.5.tar.gz'
Content type 'application/x-gzip' length 163858 bytes (160 KB)
downloaded 160 KB

Error in library(checkpoint) : there is no package called 'checkpoint'
Execution halted
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\yzton\OneDrive\Documents\R\win-library\3.3" C:\Users\yzton\AppData\Local\Temp\Rtmps9btAr/downloaded_packages/checkpoint_0.4.5.tar.gz' had status 1
Warning in install.packages :
installation of package ‘checkpoint’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\yzton\AppData\Local\Temp\Rtmps9btAr\down loaded_packages’
(This is where my knowledge gets fuzzy)
It tells you there is a Windows binary (version 0.4.2) or a source (0.4.5). Source packages are just that - more like raw R (or other language, like C, C++, etc) code - and are OS-agnostic, so can be installed on Windows (with proper tools), Mac, or *nix. But in order to work as a package on Windows it needs to be compiled. That's the binary version.

Again, I'm not sure about this, but you might need to download and install RTools in order to install source versions of packages.

Usually both the source and binary of the latest version are available; when there's a discrepancy like this it's usually just temporary (ime).

Last edited by Marcie; 09-22-2018 at 02:05 PM..
Reply With Quote
  #9  
Old 09-23-2018, 10:49 PM
kittysnight kittysnight is offline
CAS SOA
 
Join Date: Feb 2017
Location: Boston
Studying for PA
College: University of Connecticut
Posts: 7
Default

Quote:
Originally Posted by Marcie View Post
Okay, you're going to get my really non-technical explanation of this. Maybe someone who understands this stuff better can chime in.

The bold below is where it told you there were two versions, as well as which one it attempted to install:



(This is where my knowledge gets fuzzy)
It tells you there is a Windows binary (version 0.4.2) or a source (0.4.5). Source packages are just that - more like raw R (or other language, like C, C++, etc) code - and are OS-agnostic, so can be installed on Windows (with proper tools), Mac, or *nix. But in order to work as a package on Windows it needs to be compiled. That's the binary version.

Again, I'm not sure about this, but you might need to download and install RTools in order to install source versions of packages.

Usually both the source and binary of the latest version are available; when there's a discrepancy like this it's usually just temporary (ime).
Thank you! It makes more sense.
__________________
P FM MFE MLC C
APA VEE Finance Statistics Economics
FAP Module 1 2 3 4 5 IA 6 7 8 FA
Reply With Quote
  #10  
Old 09-24-2018, 08:09 AM
Marcie's Avatar
Marcie Marcie is offline
Member
CAS
 
Join Date: Feb 2015
Posts: 8,976
Default

Quote:
Originally Posted by kittysnight View Post
Thank you! It makes more sense.

Feel free to bring any other questions you might have (but please be prepared to provide error/warning messages )
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT -4. The time now is 03:30 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
*PLEASE NOTE: Posts are not checked for accuracy, and do not
represent the views of the Actuarial Outpost or its sponsors.
Page generated in 0.50666 seconds with 11 queries