formula

firstName lastName to lastName, firstName in Excel spreadsheet

半腔热情 提交于 2020-08-26 13:44:02
问题 I am trying to get an excel spreadsheet that has the names Jane Doe and John Smith, go from that to Doe, Jane, and Smith, John. I can only find ways to go from lastName, firstName to firstName lastName, but none for the contrary. Thank you. 回答1: For formulas use: =MID(A1,FIND(" ",A1)+1,999) & ", " & LEFT(A1,FIND(" ",A1)-1) Now to the next question: What if there are more than just the first and last name? Use this: =MID(A1,FIND("}}}",SUBSTITUTE(A1," ","}}}",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))

annotate a formula (with bqoute or substitute) in R (ggplot) gives Error

女生的网名这么多〃 提交于 2020-08-25 07:00:51
问题 I want to add a formula with variables in it as a annotation onto my ggplot. regline1 <- 0.00 slope1 <- 1.00 dat <- as.data.frame(c(0,1)) dat[2] <- c(0,1) names(dat) <- c("foo","bar") p <- ggplot(dat, aes(foo, bar)) + coord_fixed(ratio = 1) + geom_point() + geom_abline(slope = slope1, intercept = intercept1, linetype = "dashed") + labs(x = substitute(y[H1]==i+s%*%x,list(i=format(intercept1, digits = 1), s= format(slope1, digits = 1)))) As you can see it is no problem for ggplot to evaluate