Displaying 4 results from an estimated 4 matches for "m3bi".
Did you mean:
m3b
2017 Jul 28
0
R Programming help needed - Returning dataframes + 2 Variables dynamically
...in 1:1 ) {
test_data <- Logic_fn(x,y)
print("Returned Values :")
print(x)
print(y)
}
Wrong output :
[1] "Passed Values"
[1] 0
[1] 0
[1] "After addition :"
[1] 1
[1] 1
[1] "Returned Values :"
[1] 0
[1] 0
With Regards,
Vijaya Kumar Regati
Technical Lead, M3bi India Private Ltd
Work: 040-67064732
________________________________
From: Koustav Pal <koustavpal.devel at gmail.com>
Sent: Friday, July 28, 2017 12:25:54 PM
To: Vijaya Kumar Regati
Cc: vijaykr.sas at gmail.com; r-help at R-project.org
Subject: Re: [R] R Programming help needed - Returning...
2017 Jul 28
4
R Programming help needed - Returning dataframes + 2 Variables dynamically
...to the first declared variable and the second to the second. So,
if you called Logic_fn(y,x), then y will be assigned to x and x to y. So to
avoid such a scenario you can mention it explicitly as Logic_fn(y=y,x=x).
On Jul 28, 2017 8:39 AM, "Vijaya Kumar Regati" <VijayaKumar.Regati at m3bi.com>
wrote:
Hi,
Can someone please help me on below issue I am facing :
I am trying to play with returning a dataframe+2 variables using a fn.
But facing an issue :
Error in Logic_fn(c(x, y)) : argument "y" is missing, with no default
This is the code I am using :
x <- 0
y...
2017 Jul 28
1
R Programming help needed - Returning dataframes + 2 Variables dynamically
...the original x and y are not modified, i.e the returned value for x will be test_data[[1]] and for y will be test_data[[2]]. Using the same variable names in the function and test is perhaps what is leading to confusion.
> On 28 Jul 2017, at 09:13, Vijaya Kumar Regati <VijayaKumar.Regati at m3bi.com> wrote:
>
> Hi,
>
>
> That was very useful information. Thanks.
>
> But still I am not able to get the desired output with updated code.
>
> Kindly help if you have any further thoughts ...
>
> Updated code :
> x <- 0
> y <- 0
>
> Log...
2017 Jul 28
2
R Programming help needed - Returning dataframes + 2 Variables dynamically
Hi,
Can someone please help me on below issue I am facing :
I am trying to play with returning a dataframe+2 variables using a fn.
But facing an issue :
Error in Logic_fn(c(x, y)) : argument "y" is missing, with no default
This is the code I am using :
x <- 0
y <- 0
Logic_fn <- function(x,y){
x <- x + 1
y < y + 1
test_data <- rbind(x,y)
test_data <-