Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8656359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:15:25+00:00 2026-06-12T15:15:25+00:00

I try to run the following script in R (minimized example): library(neuralnet) arrhythmia <-

  • 0

I try to run the following script in R (minimized example):

library(neuralnet)

arrhythmia <- read.csv(file=".../arrhythmia-edited.csv", head=TRUE, sep=",")

# create the first parameter for neuralnet formular 
# format like 'classification ~ attribute1 + attribute2 + ...
# i have so many features, that why i use a for
input <- ""
for (i in 1:259)
  input <- paste(input, paste(paste('arrhythmia[,',i),'] +'))
input <- paste(input, 'arrhythmia[,260]')

# create string for function call
nnet.func <- paste('neuralnet(arrhythmia[,261] ~', input)
nnet.func <- paste(nnet.func, ', data=arrhythmia)')

# call function neuralnet
# should be like: neuralnet(arrhythmia[,261] ~ arrhythmia[,1] + arrhythmia[,2] + ... + arrhytmia[,260], data=arrhythmia)
net.arrhythmia <- eval(parse(nnet.func))

The problem is that R is parsing this as following (using Linux):

'neuralnet(arrhythmia[,261] /home/user  arrhythmia[, 1 ] + ....

How can I prevent R from parsing ~ into /home/[user-directory]?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:15:27+00:00Added an answer on June 12, 2026 at 3:15 pm

    Try using the ,text= argument. Right now you’re using the ,file= argument to parse since that comes first:

    > args('parse')
    function (file = "", n = NULL, text = NULL, prompt = "?", srcfile = NULL, 
        encoding = "unknown") 
    
    > parse("test ~ test")
    Error in file(filename, "r") : cannot open the connection
    
    > parse(text="test ~ test")
    expression(test ~ test)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error when I try to run sample example of Google
I have the following script #!/bin/sh if [cat stream_should_be_running.txt == 'true']; then #file will
When i try to run the following expect script, it just finishes running instead
IE8 is throwing a slow script error when we try and run the following
I try to run the following bash script to create a bunch of users,
I have the following PS script: function Install-BizTalkApplication { param( [Parameter(Position=0,Mandatory=$true,HelpMessage=Msi file should be
I am writing following script to read list of servers from the text file
I try to run the following raw query in android, it seems not work
I try to run the following code: public void Init(Url rootUrl) { var web
When I try to run the following SQL snippet inside a cursor loop, set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.