search for: newz

Displaying 8 results from an estimated 8 matches for "newz".

Did you mean: new
2009 May 20
3
qbinom (PR#13711)
Full_Name: Wolfgang Resch Version: R 2.8.1 GUI 1.27 OS: OS X 10.4.11 Submission from: (NULL) (137.187.89.14) Strange behavior of qbinom: > qbinom(0.01, 5016279, 1e-07) [1] 0 > qbinom(0.01, 5016279, 2e-07) [1] 16 > qbinom(0.01, 5016279, 3e-07) [1] 16 > qbinom(0.01, 5016279, 4e-07) [1] 16 > qbinom(0.01, 5016279, 5e-07) [1] 0
2013 Apr 12
1
A strange behaviour in the graphical function "curve"
..., sigma_p, mu_p) (x - mu_p)/sigma_p # The general function with several arguments BetaG <- function(mu, alpha, n, sigma, mu_0) { lasZ <- zetas(alpha) # It is a vector sigma_M <- sigma/sqrt(n) lasX <- Tzx(lasZ, sigma_M, mu_0) # Another vector(transf. from lasZ) NewZ <- Txz(lasX, sigma_M, mu) # A new vector:transf. from lasX # And the result is a single value: pnorm(NewZ[2]) - pnorm(NewZ[1]) } # Now, let's have a function of a single argument, giving # particular values to all other arguments; so miBeta depends # only on the value...
2003 Dec 09
1
How to append to a data.frame?
Hi, I have a data.frame that I need to construct iteratively. At the moment, I'm doing: d<-data.frame(x=c(),y=c(),z=()); # {and, within some loop} d<-rbind(d,data.frame(x=newx,y=newy,z=newz); While this works, it is horribly verbose and probably not efficient, either. My real data.frame has, of course, many more columns, which can be of different modes. I vaguely recall that in much earlier R versions the following worked d[dim(d)[1]+1,]<-c(newx,newy,newz); but not anymore...
2011 Oct 05
4
dynamically creating functions in r
it is possible to dynamically create functions in R using lists? what I want to do is something like this: a = list() for (i in 1:10) a[[i]] = function(seed = i) runif(seed) so that when I call a[i] I get random draws 1,2,....i unfortunately R only uses the last i . I would also like to know if there is a run-all function without explicitly looping or using lapply. for example if I
2012 Apr 05
4
Appropriate method for sharing data across functions
In trying to streamline various optimization functions, I would like to have a scratch pad of working data that is shared across a number of functions. These can be called from different levels within some wrapper functions for maximum likelihood and other such computations. I'm sure there are other applications that could benefit from this. Below are two approaches. One uses the <<-
2016 Apr 23
2
Data Frame Column Name Attribute
I am attempting to add a calculated column to a data frame. Basically, adding a column called "newcol2" which are the stock closing prices from 1 day to the next. The one little hang up is the name of the column. There seems to be an additional data column name included in the attributes (dimnames?). So when i run HEAD(DATAFRAMENAME) i get the column name = "Open". but
2010 Dec 03
3
recode letters to numbers
Hello, I have a dataframe assigning various scores on around 20 variables to a list of countries. The scores are rated on a scale of (D, C, B, A) and there are also some not rated ones (NR) and others are left blank (NA). I now wanted to transfer the scores into numeric values (such as NR=0, D=25, C=50, B=27, A=100), while also leaving the NA in the dataframe. Can I transform the whole
2012 Mar 25
2
avoiding for loops
I have data that looks like this: > df1 group id 1 red A 2 red B 3 red C 4 blue D 5 blue E 6 blue F I want a list of the groups containing vectors with the ids. I am avoiding subset(), as it is only recommended for interactive use. Here's what I have so far: df1 <- data.frame(group=c("red", "red", "red", "blue",