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

  • Home
  • SEARCH
  • 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 7774055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:16:58+00:00 2026-06-01T17:16:58+00:00

Is it possible to print the content of a file (supporting extensions like r,tex,txt,rnw)

  • 0

Is it possible to print the content of a file (supporting extensions like r,tex,txt,rnw) using R?

Reproducible file:

sink('myFile')
cat('\nThis is some text')
cat('\n')
cat('\nEnd of file')
sink()

Now I am looking for a function in R that prints the content of R as…

>PRINT_FILE_CONTENT('myFile')
This is some text
End of file
>

I hope I am clear. I will appreciate any help?

  • 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-01T17:16:59+00:00Added an answer on June 1, 2026 at 5:16 pm

    This seems to work:

    cat(readLines("myFile"),sep="\n")
    

    although I did get

    Warning message:
    In readLines("myFile") : incomplete final line found on 'myFile'
    

    at the end … you could wrap it in suppressWarnings() if you like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to print full list without using cycle? I tried: Console.WriteLine([1;2;3;4;5]) and
It is possible to overide rebol system words like print, make etc., so is
I got a script like this <?php if (file_exists(./foo.txt)) { header(Content-type: application/force-download); header(Content-length: .filesize(./foo.txt));
Possible Duplicate: Extract Table Contents using Perl I am trying to extract table content
Is it possible to retrieve a txt files content line by line? Right now
Possible Duplicate: How can I get the content of the file specified as the
Possible Duplicate: file_get_contents with https? Problems getting XML content via https using SimpleXML and
Possible Duplicate: How can I get the content of the file specified as the
I've noticed gnu-binutils-strings can printout utf-16 content in a file - is it possible
Using Powershell 2.0, is it possible to traverse directory and print files on the

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.