RStudio Cloud refresh when i run a code

Hi guys, I'm having a problem with RstudioCloud, It refresh every time i run an specific line of code, the code its a template (with tiny modifications) I've been using in other scripts and it worked properly but in this one i dont get what's going wrong, I will highlight in bold the lien of code that is giving me this problem and hope someone could help me out.

Kernel_PCA

importing the Data
dataset= read.csv('Social_Network_Ads.csv')

Spliting the dataset into the Training set and Test set

install.packages('caTools')
library(caTools)

set.seed(123)
split = sample.split(dataset$Purchased, SplitRatio = 0.75)
training_set = subset(dataset, split == TRUE)
test_set = subset(dataset, split == FALSE)

#Feature Scaling
training_set[,1:2] = scale(training_set[,1:2])
test_set[,1:2] = scale(test_set[,1:2])

#Applying Kernel_PCA
install.packages('kernlab')
library(kernlab)

kpca = kpca(~., data = training_set[-3], kernel = 'rbfdot', features = 2)
training_set_pca = as.data.frame (predict(kpca, training_set))
training_set_pca$Purchased = training_set$Purchased

test_set_pca = as.data.frame (predict(kpca, test_set))
test_set_pca$Purchased = test_set$Purchased

#Fitting Logistic regression to the Training set

classifier = glm(formula = Purchased ~ .,
family = binomial,
data = training_set_pca)

#Predicting the Test Result

prob_pred= predict(classifier, type = 'response', newdata = test_set_pca[-3])

y_pred = ifelse(prob_pred > 0.5, 1, 0)

#Making the Confusion Matrix

cm = table(test_set_pca[,3], y_pred)

#Visualising the Training set results

install.packages('ElemStatLearn')
library(ElemStatLearn)

X1 = seq(min(training_set_pca[,1]) - 1, max(training_set_pca[,1]) + 1, by = 0.01)
X2 = seq(min(training_set_pca[,2]) - 1, max(training_set_pca[,2]) + 1, by = 0.01)
grid_training_set_pca = expand.grid(X1, X2)
colnames(grid_training_set_pca) = c('V1', 'V2')
prob_training_set_pca = predict(classifier, type = 'response', newdata = grid_training_set_pca)
y_grid_pca = ifelse(prob_training_set_pca > 0.5, 1, 0)

plot(training_set_pca[,-3],
main = 'Kernel PCA (Training Set)',
xlab = 'V1', ylab = 'V2',
xlim = range(X1), ylim = range(X2))

contour(X1, X2, matrix(as.numeric(y_grid_pca), length(X1), length(X2)), add = TRUE)
points(grid_training_set_pca, pch = '.', col = ifelse (y_grid_pca == 1, 'springgreen3', 'tomato'))
points(training_set_pca, pch = 21, bg = ifelse(training_set_pca[,3] == 1, 'green4', 'red3'))