Problem with neuralnet

Hello,

I'm trying to fit a simple classification model using neuralnet, but I encounter some problems. I want to examine how L2 vowels are classified in terms of L1 vowel categories based on F1, F2, F3, and duration. My code is the following:

fit_train <- neuralnet(vowel ~ F1 + F2 + F3 + duration, hidden= 10, linear.output = FALSE, data=train)
pred <- compute(fit_train, test[,2:5])
idx <- apply(pred$net.result, 1, which.max)
predicted <- c("i", "a", "e", "o", "u") [idx]
table(test$vowel, predicted)
       predicted
         a  e  i  o  u
  had   13  0  1  0  6
  hard   0  0  0  0 20
  head  19  0  0  0  1
  heed   0 20  0  0  0
  herd   5  0  0  0 15
  hid    9  9  0  1  1
  hoard  0  0  0  0 20
  hod    0  0  0  0 20
  hood   5  0  0  0 15
  hud    2  0  0  1 17
  whod   6  2  0  2 10

The classification results I receive are far away from ideal and differ a lot from those I received from other types of analyses. I changed hidden many times, but, still, the results are not accurate. Are there any errors in the code? Any suggestions?

with a single number, it is giving you a shallow network with only 1 layer. if you want to try 10 layers deep each of width 10 use
hidden=c(10,10)

I tried it but I get nonaccurate results again. Is the code OK?

I don't see any obvious howlers, so my estimate is that the code is probably ok.

I'm wondering whether neuralnet is able to conduct crosslinguistic analyses with a dependent variable including different levels in the trained and testing modalities (e.g. L1 vs L2 vowels for vowel) just like my example.

I don't see why not in principle...
if your data contains a reasonable amount of signal to noise to be detected, I would expect neuralnets to be in the running for workable methods to detect them.