search for: mytwo

Displaying 4 results from an estimated 4 matches for "mytwo".

2011 Jun 09
1
Trying to make code more efficient
...mparison"), state = c(state), inscompany = c(inscompany), city=c(city), cityst = c(cityst), agency=c(agency)) myone <- function(x, y) { m1 <- do.call(paste, expand.grid(lst[[x]], lst[[y]])) mydf <- data.frame(keyword=c(m1)) } mytwo <- function(x, y, z){ m2 <- do.call(paste, expand.grid(lst[[x]], lst[[y]], lst[[z]])) mydf2 <- data.frame(keyword=c(m2)) } d1 = mytwo("prefix", "roots", "suffix") d2 = mytwo("prefix", "roots", "suf...
2011 Jun 09
1
Error: missing values where TRUE/FALSE needed
...quot;), prefix2 = c("low cost"), suffix = c("quote", "quotes"), suffix2 = c("rate", "rates"), suffix3 = c("comparison")) myone <- function(x, y) { nu <- do.call(paste, expand.grid(lst$x, lst$y)) mydf <- data.frame(keyword=c(nu)) } mytwo <- function(x, y, z){ mu <- do.call(paste, expand.grid(lst$x, lst$y, lst$z)) mydf2 <- data.frame(keyword=c(mu)) } d1 = mytwo(lst$prefix, lst$roots, lst$suffix) d2 = mytwo(lst$prefix, lst$roots, lst$suffix2) d3 = mytwo(lst$prefix, lst$roots, lst$suffix3) d4 = mytwo(lst$prefix2, lst$roots, l...
2011 Jun 09
2
Problem with a if statement inside a function
...c("rate", "rates"), suffix3 = c("comparison"), state = c(state), inscompany = c(inscompany), city=c(city), cityst = c(cityst)) myone <- function(x, y) { m1 <- do.call(paste, expand.grid(lst[[x]], lst[[y]])) } mytwo <- function(x, y, z){ m2 <- do.call(paste, expand.grid(lst[[x]], lst[[y]], lst[[z]])) } d1 = mytwo("prefix", "roots", "suffix") d2 = mytwo("prefix", "roots", "suffix2") d3 = mytwo("prefix",...
2011 Jun 09
1
Using a function inside a function
...t;, "quotes"), suffix2 = c("rate", "rates"), suffix3 = c("comparison")) myfunc <- function(lst) { myone <- function(x, y) { nu <- do.call(paste, expand.grid(x, y)) mydf <- data.frame(keyword=c(nu)) } mytwo <- function(x, y, z){ mu <- do.call(paste, expand.grid(x, y, z)) mydf2 <- data.frame(keyword=c(mu)) } d1 = mytwo(lst$prefix, lst$roots, lst$suffix) d2 = mytwo(lst$prefix, lst$roots, lst$suffix2) d3 = mytwo(lst$prefix, lst$roots, lst$suffix3)...