Skip to content
Back to formatted view

Raw Message

Message-ID: <1352728173783-4649303.post@n4.nabble.com>
Date: 2012-11-12T13:49:33Z
From: alen
Subject: problem with Erlang  function

I'm beginner with R language

My goal is to write a function that takes an input Erlang entering your

? Name

? Name

? Date of birth.

The program will calculate age and display output

first
I do know the system date (month, day, year)

I find with Sys.Date ()


I found a function. net to calculate the age



Protected Sub calcul_age()
    Dim datetimenow = DateTime.Now
    Dim datedenaissance = CDate(TbDn.Text)
    Dim age As Integer
    age = CInt(Now.Year - datedenaissance.Year)
    If (datedenaissance.Month > Now.Month) Then
    age = age - 1
    End If
    If ((datedenaissance.Month = Now.Month) And (datedenaissance.Day >
Now.Day)) Then
    age = age - 1
    End If
    Me.Label3.Text = " Age : " & age & " ans"
    End Sub




So I need to find the equivalent of this function with R language


so I think that I will start by :

affichage<-function()
{

print( "enter the first name" )
firstname <-  scan(nmax=1)
print( "enter the last name" )
 lastname <-  scan(nmax=1)
print( "enter the date of birth" )
dateofbirth <-  ........  here start the problem

........
............


}



--
View this message in context: http://r.789695.n4.nabble.com/problem-with-Erlang-function-tp4649303.html
Sent from the R help mailing list archive at Nabble.com.