search for: c_d

Displaying 6 results from an estimated 6 matches for "c_d".

Did you mean: _d
2013 Mar 02
3
if value is in vector, perform this function
...that makes sense. Here's what I have (and it doesn't work): params = c(1, 0.15, 0.164, 1) init = c(1.5, 0.05) t=seq(1,60, by=0.5) #all time values, experiment ran for 60 days #feeding sequence - every "3.5 days" feed_days = seq(1,60,by=3.5) Daphnia <- function(t,x,params){ C_D = x[2]; C_A = 0; for(t %in% feed_days){ if t == TRUE { C_A = 1.5 } else{ C_A = 0 }} gamma = params[1]; m_D = params[2]; K_q = params[3]; q_max = params[4]; M_D = m_D * C_D I_A = (C_D * q_max * C_A) / (K_q + C_A) r_D = gamma * I_A return( list(c( - I_A, r_D - M_D ))) } libra...
2012 Aug 09
1
Zoo object problem: problem when I attempt to create a zoo object of only one column
...ct "NULL"? It should be one, shouldn't it? (The following example does not involve the creation of a zoo object; in reality, similar problems are encountered when I create a zoo object) > temp5<-read.csv("A_Consumption.csv", header=TRUE)> temp5[1:3,] TIME C C_D C_ND 1 196101 70345 1051 69294 2 196102 61738 905 60833 3 196103 63838 860 62978> temp6<-temp5[,2:ncol(temp5)]> temp6[1:3,] C C_D C_ND 1 70345 1051 69294 2 61738 905 60833 3 63838 860 62978> colnames(temp6)[1] "C" "C_D" "C_ND"> temp7<-re...
2012 Aug 10
2
Zoo object problem: Find the column name of a univariate zoo object
...4 1 > > R> dim(z) <- c(NROW(z), NCOL(z)) > R> z > > 1 0.8414710 > 2 0.9092974 > 3 0.1411200 > 4 -0.7568025 > R> dim(z) > [1] 4 1 > > > temp5<-read.csv("A_**Consumption.csv", header=TRUE)> temp5[1:3,] TIME >>> C C_D C_ND >>> >> 1 196101 70345 1051 69294 >> 2 196102 61738 905 60833 >> 3 196103 63838 860 62978> temp6<-temp5[,2:ncol(temp5)]> temp6[1:3,] >> C C_D C_ND >> 1 70345 1051 69294 >> 2 61738 905 60833 >> 3 63838 860 62978> colnames(te...
2010 Oct 26
4
divide column in a dataframe based on a character
Hello, If I have a dataframe: example(data.frame) zz<-c("aa_bb","bb_cc","cc_dd","dd_ee","ee_ff","ff_gg","gg_hh","ii_jj","jj_kk","kk_ll") ddd <- cbind(dd, group = zz) and I want to divide the column named group by the "_", how would I do this? so instead of the first row being x y fa...
2010 Aug 19
1
Help with Vectors and conditional functions
Good morning, I have something like this: names(coint_tests) <- apply(b,2,paste, collapse="_") which prints 15 names like: A_B, C_D, E_F, ... AA,B,C,D.. Are time series. Then there is a vector called coint_tests of length 15 which yields "yes" or "no". I need to add a function to plot the time series Ai_Bi if the coint_tests vectors gives me a "YES". I tried: for (i in 1:(length(coint_tests))...
2009 Aug 28
1
problems with strsplit using a split of ' \\\ ' : a regex problem
...a simple little function to do this: get.first.id.func <- function(vec, splitter){ vec.lst <- strsplit(vec, splitter) first.func <- function(vec1){vec1[1]} vec.out <- sapply(vec.lst, first.func) vec.out } For a trivial example, this works: > a <- c("a_b", "c_d") > get.first.id.func(a, "_") [1] "a" "c" I am running into problems, however, with the real world split of ' \\\ ' I'm not even able to construct a sample vector of my own! Here is what I get: > a <- c('a \\\ b', 'a \\\ b') &...