Print Only When Condition is True in R
问题 This solution Automate Seed as a Vector Instead of an Integer in R library(forecast) SEED_vector <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19) arima_order_results = data.frame() for (my_seed in SEED_vector){ set.seed(my_seed) ar1 <- arima.sim(n = 10, model=list(ar=0.2, order = c(1, 0, 0)), sd = 1) ar2 <- auto.arima(ar1, ic ="aicc") arima_order = arimaorder(ar2) arima_order = t(as.data.frame(arima_order)) # Print the arima order. print(arima_order) # This line of code is just if you