search for: another_valu

Displaying 3 results from an estimated 3 matches for "another_valu".

Did you mean: another_value
2007 Oct 20
1
Getting at what a named object represents in a function...
...mbiguous). Imagine its like this (actual values are unimportant) and called mylist: >mylist A B 1 5 2 5 3 6 4 8 5 0 I have a function: foo = function(param){ #modify list A or B values depending on whether A or B's passsd in (via 'param') param[someindex]=another_value #doesn't change value in lits$A or list$B (whichever's been passed in as 'param') #I want something like: #if 'param' is list$A then list$A[someindex]=another_value #else if 'param' is list$B then list$B[some_index] = another_value } I then call this function on...
2005 Apr 22
1
Beginner in R
hello ( and sorry for my poor english ... ) I'm a newbie on R software and I need to obtain this kind of system : a structure, like a liste : my_struct <- list() my_struct$a <- a_value my_struct$b <- another_value my_struct$c <- one_more_value and a function with two args : the first is a instance of the structure, and the second is any component of the structure (here $a, $b or $c) and the function will do some transformations on this component : my_func <- function(a_struct, a_comp) { a_comp...
2006 Oct 06
8
Expecting calls with two different parameters
Hello, I''ve just started using Mocha in the tests for my Rails app, and I''ve run across an issue with mocking a method that should be called with different parameters. How would I setup a mock that expects that a method will be called once with no paramaters, and a second time with a parameter? I''d be tempted to shortcut and just do something like