-1

I was making a package in R and would like it to make it as a trial version for a period of 30 days .

Well my question is how to make a code self destructive depends on number of days ??

I had played with time and date package for a while where i came to know ,

Sys.Date() could give todays date , so i get forard with something below

today=Sys.Date()
a=today
b=a+1
if(a==today)
{ 
   print(paste("today is  sunday"))
   if(b==today){
       print(paste("today  is  monday"))
    }             

I know it is stupid work whatever i had done , my sole idea was to fix the 1st use of package as starting day ,and every day it will increment till 30 days ,when it will reach the limit it will automatically destroy using

file.remove () <- through which I can remove some file ........

May be I am clear with my ideas .

Sorry for the novice question .

  • 3
    The code will be open source, so isn't this kind of moot? – Thomas May 17 '14 at 07:05
  • Thanks for the reply @Thomas , yes i know , but when we make the code as a package ,isnt it for hiding it from someone ? Its not for publishing its for self use ...........:) – user3646930 May 17 '14 at 07:10
  • 2
    So you plan to restrict your use of your own package to a 30 day trial? – thelatemail May 17 '14 at 07:12
  • It is for some client to use ,which we want to give him for trial @thelatemail :) – user3646930 May 17 '14 at 07:14
  • Why the trial period? So people will have to pay after that period to continue using the package? If you need money, giving the package away for free and asking for donations might be a better way. – Paul Hiemstra May 17 '14 at 07:19
  • 2
    Once they install the package, the source is visible. – Thomas May 17 '14 at 07:20
  • 6
    R and its package system is designed to be open source. That is one reason for the success of the language and makes it impossible to this reliably with R. – Roland May 17 '14 at 09:08
  • When code is published as a package all the code is also open source, that's what makes R great and most R users like that it is open source. If you want to charge for a package then you will probably not find a very welcoming audience with R users. – JeremyS May 17 '14 at 10:28
  • Well…a binary package with individual downloads per-platform, with the majority of the code in `Rcpp` and that is generated on-the fly when downloaded with a complied-in "kill date" **could** work. It's insane, but it could work. – hrbrmstr May 17 '14 at 13:43
  • 1
    Another option: let them "try" via a hosted Shiny version then sell the package with a compiled-in license. – hrbrmstr May 17 '14 at 13:46
  • 4
    You'll get the same answers here as you get when posting to R-help. Don't post to both, it wastes everyones time. – Spacedman May 17 '14 at 15:34

1 Answers1

2

Add this condition to the license. ("30 days for free, after that you'll have to pay".) and expect users to comply with this.

There is really nothing else you can do.

Well, actually you can. For example, on the first occasion your code is run, save the current date to a file in a certain location (say, "~/.datetocheck"). Then every time your code is run, check for the existence of this file, and if it exists, compare the dates. If more than 30 days have passed, give an error message:

stop("Time is over! You have to pay!")

The problem is that nothing prevents the user from simply deleting this file.

lebatsnok
  • 6,329
  • 2
  • 21
  • 22
  • 1
    But one of the major pillars of `R` is that all its code be open source. If you were to try to sell a package, you'll most likely be shunned by the user community in the first place (and more than likely someone will write a better version of your tool and release it under LGPL). – Carl Witthoft May 17 '14 at 20:23