Displaying 2 results from an estimated 2 matches for "firstaccount".
2018 Jan 02
3
Help with first S3-class
...function() {
return(pastSaldo)
},
plot = function() {
plot.new()
lines(list(y = pastSaldo, x = seq_along(pastSaldo)))
}
)
assign('this', me, envir = thisEnv)
class(me) <- append(class(me), "account")
return(me)
}
FirstAccount <- account("Martin")
FirstAccount$deposit(100)
FirstAccount$withdraw(50)
FirstAccount$deposit(200)
FirstAccount$balance()
FirstAccount$pastSaldo()
FirstAccount$plot()
plot(FirstAccount) # fails
plot.account(FirstAccount) # fails
2018 Jan 02
0
Help with first S3-class
...= function() {
> plot.new()
> lines(list(y = pastSaldo, x = seq_along(pastSaldo)))
> }
> )
> assign('this', me, envir = thisEnv)
>
> class(me) <- append(class(me), "account")
> return(me)
> }
>
> FirstAccount <- account("Martin")
> FirstAccount$deposit(100)
> FirstAccount$withdraw(50)
> FirstAccount$deposit(200)
> FirstAccount$balance()
> FirstAccount$pastSaldo()
>
> FirstAccount$plot()
>
> plot(FirstAccount) # fails
> plot.account(...