Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
. Nilesh From: William Dunlap [mailto:wdun...@tibco.com] Sent: Thursday, December 14, 2017 11:26 AM To: DIGHE, NILESH [AG/2362] Cc: Eric Berger ; r-help Subject: Re: [R] help with recursive function Your code contains the lines stopifnot(!(any(data1$norm_sd >= 1)))

Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
stopifnot condition is met. When the stopifnot condition is met, I like to get the output from if statement saved. Anyway, I will keep trying. Again, Thanks for your help! Nilesh From: Eric Berger [mailto:ericjber...@gmail.com] Sent: Thursday, December 14, 2017 10:29 AM To: DIGHE, NILESH [AG/2362

Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
atment, value) %>% mutate(outlier = NA) stopifnot(!(any(data1$norm_sd >= 1))) if (!(any(data1$norm_sd >= 1))) { df1 <- dat1 return(df1) } else { df2 <- recursive_funlp() return(df2) } } df3 <-

Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
ic Berger [mailto:ericjber...@gmail.com] Sent: Thursday, December 14, 2017 8:17 AM To: DIGHE, NILESH [AG/2362] Cc: r-help Subject: Re: [R] help with recursive function My own typo ... whoops ... !( any(dat2$norm_sd >= 1 )) On Thu, Dec 14, 2017 at 3:43 PM, Eric Berger mailto:ericjber...@

[R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
Hi, I need some help with running a recursive function. I like to run funlp2 recursively. When I try to run recursive function in another function named "calclp" I get this "Error: any(!dat2$norm_sd) >= 1 is not TRUE". I have never built a recursive function before so having trouble executing it

Re: [R] dynamically create columns using a function

2017-07-21 Thread DIGHE, NILESH [AG/2362]
dataset = dat, col = col_mean_gg, col_name = col_name_gg) dat2 } # function demo_fn demo_fn<- function (dat, f, blup_datacut) { for (i in blup_datacut) { dat <- f(dat, i) } dat } # get expected results by applying functions demo_fn(dem, f, c("REG1", &

[R] dynamically create columns using a function

2017-07-20 Thread DIGHE, NILESH [AG/2362]
Hi, I am writing a function to dynamically create column names and fill those columns with some basic calculations. My function "demo_fn" takes argument "blup_datacut" and I like to use the contents of those arguments to dynamically create new columns in my dataset. Please note that I have anot

Re: [R] Why is merge sorting even when sort = F?

2017-03-09 Thread DIGHE, NILESH [AG/2362]
Using the "join" function from the plyr package preserves the data order library(plyr) join(grades2, info, by="grade", type="left", match="all") Nilesh -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Dimitri Liakhovitski Sent: Wednesday, March 08, 2017

Re: [R] Understanding and predict round-off errors sign on simple functions

2016-06-30 Thread DIGHE, NILESH [AG/2362]
Using "runmean" function from caTools package within your SMA function appears to solve the issue. Please see details below. library(caTools) > dput(m) structure(c(-0.626453810742332, 0.183643324222082, -0.835628612410047, 1.59528080213779, 0.329507771815361, -0.820468384118015, 0.487429052428

Re: [R] sample within a loop

2016-03-20 Thread DIGHE, NILESH [AG/2362]
Tanvir & Don: Thanks a lot for your solutions. Both solutions work great. I really appreciate your help. Regards, Nilesh -Original Message- From: Mohammad Tanvir Ahamed [mailto:mashra...@yahoo.com] Sent: Thursday, March 17, 2016 1:24 PM To: DIGHE, NILESH [AG/2362]; r-he

[R] sample within a loop

2016-03-19 Thread DIGHE, NILESH [AG/2362]
Dear R users, My data frame has four "groups" namely A1, B2, C3, & D4. Each group has 12 rows (variable "plotno). I like to randomly sample one "plotno" within each "groups" variable and label it as "CONTROL" and label others as "TEST" in a new variable called "entry". I am tr

Re: [R] store results from loop into a dataframe

2016-01-05 Thread DIGHE, NILESH [AG/2362]
Sarah: Thanks a lot for taking time to guide me to the right direction. I now see how the missing data is causing the problem. Thanks again! Nilesh -Original Message- From: Sarah Goslee [mailto:sarah.gos...@gmail.com] Sent: Tuesday, January 05, 2016 12:13 PM To: DIGHE, NILESH [AG/2362

Re: [R] store results from loop into a dataframe

2016-01-05 Thread DIGHE, NILESH [AG/2362]
handle these errors. Do you recommend any other approach to solve my problem? Thanks for your time. Nilesh -Original Message- From: Sarah Goslee [mailto:sarah.gos...@gmail.com] Sent: Tuesday, January 05, 2016 11:20 AM To: DIGHE, NILESH [AG/2362] Cc: r-help@r-project.org Subject: Re

[R] store results from loop into a dataframe

2016-01-05 Thread DIGHE, NILESH [AG/2362]
Dear R users: I am trying to create a function that will loop over three dependent variables in my aov model, and then get the HSD.test for each variable. I like to store the results from each loop in a data frame. When I run my function (funx) on my data (dat), results from only yield gets

Re: [R] subset data using a vector

2015-11-24 Thread DIGHE, NILESH [AG/2362]
t;V046", "V047", "V048", "V049", "V050", "V051", "V052", "V053", "V054", "V055", "V056", "V057"), class = "factor"), linecode = structure(c(1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

Re: [R] subset data using a vector

2015-11-23 Thread DIGHE, NILESH [AG/2362]
lit(as.character(dataset$ranges2use), ",")[[i]]) } m2 } I am not sure where I am making a mistake. Thanks. Nilesh -Original Message- From: Michael Dewey [mailto:li...@dewey.myzen.co.uk] Sent: Monday, November 23, 2015 12:11 PM To: DIGHE, NILESH [AG/2362]; r-help@r-pro

Re: [R] subset data using a vector

2015-11-23 Thread DIGHE, NILESH [AG/2362]
Michael: I like to use the actual range id's listed in column "rangestouse" to subset my data and not the length of that vector. Thanks. Nilesh -Original Message- From: Michael Dewey [mailto:li...@dewey.myzen.co.uk] Sent: Monday, November 23, 2015 10:17 AM To: DIGHE,

[R] subset data using a vector

2015-11-23 Thread DIGHE, NILESH [AG/2362]
Dear R users, I like to split my data by a vector created by using variable "ranges". This vector will have the current range (ranges), preceding range (ranges - 1), and post range (ranges + 1) for a given plotid. If the preceding or post ranges in this vector are outside the l

[R] spatial adjustment using checks

2015-10-22 Thread DIGHE, NILESH [AG/2362]
Hi, I have yield data for several varieties and a randomly placed check (1 in every 8 column or "cols") in a field test arranged in a rows*cols grid format (see image attached). Both "rows" & "cols" are variables in the data set. I like to adjust "yield" variable for each row listed as "variet

Re: [R] help with "by" function

2015-05-12 Thread DIGHE, NILESH [AG/2362]
Jean: Thanks a lot!! The changes you made to the code gave me what I needed. I truly appreciate your time in correcting the code. Nilesh From: Adams, Jean [mailto:jvad...@usgs.gov] Sent: Tuesday, May 12, 2015 2:14 PM To: DIGHE, NILESH [AG/2362] Cc: r-help@r-project.org Subject: Re: [R] help

[R] help with "by" function

2015-05-12 Thread DIGHE, NILESH [AG/2362]
Hi, I have an anonymous function called function(x) that will run anova, run HSD.test on the model, and then sort the results. I am passing this anonymous function to the "by" function to get results by "Isopair" factor which is my index variable. Since I want to run the anova on multiple depe

[R] Bayesian estimates for the 1st-order Spatial Autoregressive model

2012-08-07 Thread CARTIER, ADRIAN AW (AG/1000)
Greetings: I am a relatively new user to R. I was wondering if anyone is familiar with MATLAB's far_g() function. If yes, is there an R equivalent to this? I would like to have the ability to input as my observation vector continuous values. I noticed that there was something close in R

[R] How to code mixed model with nested factors in lmer

2010-06-11 Thread ZHAO, HUIYAN [AG/1005]
Hi, I have coding question on mixed model in R. I am using R2.11.0 in windows. I have an experiment with 2 fixed effect factors - A and B. The levels of B are within the levels of A factor. The model is very similar to a split plot design except the nesting relationship between the 2 fixed effe

Re: [R] RKWard: R backend requests information

2009-06-02 Thread AG
Romain Francois wrote: Hi, rkward has its own mailing list where people will be able to help you. https://lists.sourceforge.net/lists/listinfo/rkward-users Romain AG wrote: Hello List I've decided to dive into R and found a useful GUI for GNU/Linux (Debian testing/ Squeeze) called R

[R] RKWard: R backend requests information

2009-06-02 Thread AG
usr/bin/R; /etc/R; and so on) but none of these work, and the darn thing won't go away without killing the entire program. It also will not allow me to by-pass it, nor access any help files, etc. Does anyone know just what "backends" i

Re: [R] [OT?]R Reference Manual review/recommend

2009-05-14 Thread AG
ing of > R than as an intro for a complete novice who is not a statistician. > Oh yes, it's also much easer to use in PDF form than in the HTML format. > > --- On Wed, 5/13/09, AG wrote: > > >> From: AG >> Subject: [R] [OT?]R Reference Manual review/recom

[R] [OT?]R Reference Manual review/recommend

2009-05-13 Thread AG
Hello all I am looking to learn R and was thumbing through volume 1 of "R reference manual - Base Package". I'm sorry if this is ludicrously silly to ask, but is this book worth the investment as a good way to learn how to use R? AG

[R] maximum allowed matrix size of R

2008-03-14 Thread LIU, YUEFU [AG/1000]
Hi! All, I was thinking to use R to handle my large scale data of 3 Mi records On Unix. Could you let me know if there is limits of R for its matrices and vectors and what is the maximum allowed size if there is ? Thank you advance Yuefu St Louis -