search for: ninah

Displaying 20 results from an estimated 89 matches for "ninah".

Did you mean: nina
2010 Oct 01
3
Suppressing printing in the function
Hello! I wrote a function that returns a data frame. Nowhere in the function do I say print(my.data.frame), but when I run the function - the data frame is printed on the console. Is there any way to suppress it? Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 Feb 24
4
Running code sequentially from separate scripts (but not functions)
...code: d = 10; e = d - c Script in the file "code3.r" contains the code: result=e/a I understand that I could write those 3 scripts as 3 functions and source them from another script. But maybe there is a way of having them run one by one as such? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2010 May 08
1
Increasing the font size on axes in trellis
...t;Mean Deviation from GDW Importances",cex=1.5,font=2), ? ? ? ?panel = function(y,x,...) { ? ? ? ? ? ? ? ?panel.grid(h = -1, v = -1) ? ? ? ? ? ? ? ?panel.xyplot(x, y, ...) ? ? ? ? ?ltext(x, y, labels=round(y,2),cex=1.5,col="black",font=1,pos=4) ? ? ? }) -- Dimitri Liakhovitski Ninah Consulting www.ninah.com -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 Feb 25
6
preventing repeat in "paste"
...;-"end" middle<-as.character(c(1,2,3)) I would like to get the following result: "start 123 end" or "start 1 2 3 end" or "start 1,2,3 end" How can I avoide this (undesired) result: paste(s,middle,e,sep=" ") Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2009 Oct 13
4
replacing period with a space
...bb","cc.dd.ee")) x$x<-as.character(x$x) x I am sorry for such a simple question - but how can I replace all periods in x$x with spaces? sub('.', ' ', x$x) - removes all letters to the left of each period... Thanks a lot for your advice! -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2010 Mar 04
4
Analogue to SPSS regression commands ENTER and REMOVE in R?
I am not sure if this question has been asked before - but is there a procedure in R (in lm or glm?) that is equivalent to ENTER and REMOVE regression commands in SPSS? Thanks a lot! -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2011 Feb 03
1
rgenoud for multiple chips: does a more recent special version of "snow" exist?
...nstall it (from a zip file) because it was created before R 2.10. Does anyone know if a more updated special version of "snow" exists - that could be used on R 2.12? Or maybe there is another way of running rgenoud on several chips simultaneously? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2009 Sep 23
2
Function to check if a vector contains a given value?
Dear R'rs, is there a function that checks if a given vector contains a certain value. E.g., x<-c(1,2,3,4). How can I get a TRUE or FALSE for whether x contains a 2? -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2010 Mar 18
1
R takes long time to open
...ot;Previous saved work space restored" - even if I have not saved any workspace or, in case of R2.10 - even though I have not used it once. In the older versions - R would start within 2-3 sec. Is there any way to change some setting to make R open faster? Thank you! -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2010 Oct 29
1
help pages do not open
...some reason, Google Chrome stopped opening web pages. At the same time R11 stopped showing help pages. Then, I uninstalled Google Chrome and defined IE as my default browser. Then, I uninstalled R11 and installed R12 instead. But I am getting the same error. Any advice? -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2010 Aug 13
3
transforming dates into years
...rs, I currently do it like this using "zoo": library(zoo) as.year <- function(x) as.numeric(floor(as.yearmon(x))) myFrame$year<-as.year(myFrame$date) Is there a function that would do it directly - like "as.yearmon" - but for years? Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 Mar 30
3
optim and optimize are not finding the right parameter
...t1$par) # is much larger than the value of "test" above. # And getting the same - wrong - result with optimize: opt2 <- optimize(f=my.function,interval=c(0,0.1)) test3<-my.function(opt2$minimum) What am I doing wrong? Thanks a lot for your recomendations! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 May 23
1
weird problem - R is not finding the data for the factor level present in the data
...dma_id %in% "OH1054"] # - or: >daily$dma_id[daily$dma_id %in% levels(daily$dma_id)[109]] factor(0) As a result I can't rename those levels. It's not a real problem - I can do replace in the raw txt file. But still, why is it happening? Thank you! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2010 Oct 25
3
finding the year of a date
I know that I can use as.yearmon in the package "zoo" to find the year and the month of a date. I can use as. yearqtr to find the year and the quarter. But how can one find just the year of a date? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2011 Feb 07
1
Question about checkTmvArgs function in rtmvnorm (package tmvtnorm)
...uot;gibbs") { retval <- rtmvnorm.gibbs.Fortran(n, mean, sigma, lower, upper, ...) } else if (algorithm == "gibbsR") { retval <- rtmvnorm.gibbs(n, mean, sigma, lower, upper, ...) } return(retval) } -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2010 Mar 30
4
Code is too slow: mean-centering variables in a data frame by subgroup
...e ### Code that does what's needed but is too slow: Start<-Sys.time() frame <- do.call(cbind, lapply(names.used, function(x){ unlist(by(frame, frame$group, function(y) y[,x] / mean(y[,x],na.rm=T))) })) Finish<-Sys.time() print(Finish-Start) # Takes too long -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2010 Nov 03
2
biding rows while merging at the same time
...ion date a b c d loc 1 1/1/2010 1 11 111 NA loc 2 1/1/2010 2 12 112 NA loc 3 1/1/2010 3 13 113 NA loc 1 2/1/2010 3 NA 114 1 loc 2 2/1/2010 5 NA 115 11 loc 3 2/1/2010 6 NA 116 111 Thanks a lot for your suggestions! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2010 Mar 09
2
looping through predictors
...reg<-lm(y~i) etc. } But it's not working. I am getting an error: Error in model.frame.default(formula = Y ~ x1 + x2 + x3 + i, data = sample, : variable lengths differ (found for 'i') How can I make it take predictor names in the lm formula? Thank you! -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com
2010 Aug 04
6
applying strsplit to a whole column
...aba","X..abb","X..abc","X..abd")) x$names<-as.character(x$names) (x) str(x) Can't figure out how to apply strsplit in this situation - without using a loop. I hope it's possible to do it without a loop - is it? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com
2009 Sep 17
2
referring to a row number and to a row condition, and to columns simultaneously
...4:5]<-c(8,9) x[i & x[[1]]!=1,4:5]<-c(101,102) } x However, something is wrong here. First, rows 1 and 6 are not ignored. Second, the order of 101 and 102 changes - I, however, always want to see 101 in column d and 102 in column e. Any advice? Thanks a lot! -- Dimitri Liakhovitski Ninah.com Dimitri.Liakhovitski at ninah.com