The code you posted gives the critical value for a one-sided test (Hence the answer to you question is simply:
abs(qt(0.25, 40)) # 75% confidence, 1 sided (same as qt(0.75, 40))
abs(qt(0.01, 40)) # 99% confidence, 1 sided (same as qt(0.99, 40))
Note that the t-distribution is symmetric. For a 2-sided test (say with 99% confidence) you can use the critical value
abs(qt(0.01/2, 40)) # 99% confidence, 2 sided
Josh’s comments are spot on. If you are not super familiar with critical values I’d suggest playing with qt, reading the manual (?qt) in conjunction with looking at a look up table (LINK). When I first moved from SPSS to R I created a function that made critical t value look up pretty easy (I’d never use this now as it takes too much time and with the p values that are generally provided in the output it’s a moot point). Here’s the code for that:
critical.t <- function(){
cat("n","bEnter Alpha Level","n")
alpha<-scan(n=1,what = double(0),quiet=T)
cat("n","b1 Tailed or 2 Tailed:nEnter either 1 or 2","n")
tt <- scan(n=1,what = double(0),quiet=T)
cat("n","bEnter Number of Observations","n")
n <- scan(n=1,what = double(0),quiet=T)
cat("nnCritical Value =",qt(1-(alpha/tt), n-2), "n")
}
critical.t()