Displaying 5 results from an estimated 5 matches for "suffix2".
Did you mean:
suffix
2011 Jun 09
1
Trying to make code more efficient
...task.
lst <- list(roots = c("car insurance", "auto insurance"),
roots2 = c("insurance"), prefix = c("cheap", "budget"),
prefix2 = c("low cost"), suffix = c("quote", "quotes"),
suffix2 = c("rate", "rates"), suffix3 = c("comparison"),
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]])...
2011 Jun 09
1
Error: missing values where TRUE/FALSE needed
...g error message.
myfunc <- function(lst) {
lst <- list(roots = c("car insurance", "auto insurance"),
roots2 = c("insurance"), prefix = c("cheap", "budget"),
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 <-...
2011 Jun 09
2
Problem with a if statement inside a function
...)
lst <- list(roots = c("car insurance", "auto insurance"),
roots2 = c("insurance"), prefix = c("cheap", "budget"),
prefix2 = c("low cost"), suffix = c("quote", "quotes"),
suffix2 = 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]]))
}...
2011 Jun 09
1
Using a function inside a function
...n inside a function but get an error message.
lst <- list(roots = c("car insurance", "auto insurance"),
roots2 = c("insurance"), prefix = c("cheap", "budget"),
prefix2 = c("low cost"), suffix = c("quote", "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){...
2011 Jun 07
1
Adding values to the end of a data frame
...insurance", "auto insurance")
prefix <- c("cheap", "budget")
suffix <- c("rate", "rates")
one <- function(x, y, z=0) {
nu <- do.call(paste, expand.grid(x, y, z))
mydf <- data.frame(nu)
print(mydf)
}
one(roots, suffix2)
one(prefix, roots)
one(prefix, roots, suffix2)
The code above just replaces each value in the data frame each time I run
the one function.
How can I add the new values to the end of the data frame?
Help!
I'm running R 2.13 on Ubuntu 10.10
WebRep
Overall rating
[[alternative HTML version...