Displaying 3 results from an estimated 3 matches for "balqis".
2012 Oct 16
4
how to extract from list
Hi all,
I have a list of 20000 data, and the list look like below. I wonder what is
the simplest way to extract 'kappa' value (or 'xi' or 'alpha' for the
matter) from each of the data. How can I simply code it without having to
change the list to a dataframe first? Many thanks!
$X19997
xi alpha kappa
784.7718640 165.4065141 -0.2709599
$X19998
2012 Oct 22
4
creating a function using for if
Hi all,
I'm trying to create a function where it can process a vector and also give
a vector output accordingly
#input: a,b anc c are constants, data is the vector
#set the function
fun<-function(a,b,c,data)
{
N=as.vector()
for (i in min(data):max(data)){
if(i>c){
N<-(a*(i-c)^0.5)+(b*(i-c))}
else
{N<-0}}
return(N)
}
#try dummy
data=c(100,210,320,130,170,120,220,90,55,45)
2012 Oct 17
3
z.test for dataframe
Hi!
I'm trying to use sapply to my dataframe for z.test function (teaching
demos package)
Sep=cbind(kIp,k02p,k04p,k07p)
Sep=as.data.frame(Sep)
kzt=sapply(Sep, function(m) z.test(m,sd(m)))
Error in z.test(m, sd(Sep)) :
You must specify a Standard Deviation of the population
kzt=sapply(Sep, function(m) z.test(m,sd(Sep)))
Error in z.test(m, sd(Sep)) :
You must specify a Standard Deviation