如何将以下用 python 编写的代码写入 R ?
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
以 80/20 的比例拆分为训练集和测试集。
python r machine-learning train-test-split
machine-learning ×1
python ×1
r ×1
train-test-split ×1