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 8868543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:17:49+00:00 2026-06-14T17:17:49+00:00

I am having R sample from data 100 times then write those to a

  • 0

I am having R sample from data 100 times then write those to a text file that my boss can then load into Excel. I currently have R doing the samples but when it comes to writing I can’t get the results to be in a single column just different rows. I have tired writeLines, write.table, write, and write.csv. The closest I can get is using write.table.

Dataset <- read.table("clipboard", header=FALSE, sep="", na.strings="", dec=".", strip.white=TRUE)
ThePath = ""
*Replace with where you want it to save
P = .25
*Put the Percentage Value you want to use here
X = round(nrow(Dataset)*P)
Boot1 = sum(sample(Dataset$V1, size=X))
Boot2 = sum(sample(Dataset$V1, size=X))
Boot3 = sum(sample(Dataset$V1, size=X))
Boot4 = sum(sample(Dataset$V1, size=X))
Boot5 = sum(sample(Dataset$V1, size=X))
Boot6 = sum(sample(Dataset$V1, size=X))
Boot7 = sum(sample(Dataset$V1, size=X))
Boot8 = sum(sample(Dataset$V1, size=X))
Boot9 = sum(sample(Dataset$V1, size=X))
Boot10 = sum(sample(Dataset$V1, size=X))
Boot11 = sum(sample(Dataset$V1, size=X))
Boot12 = sum(sample(Dataset$V1, size=X))
Boot13 = sum(sample(Dataset$V1, size=X))
Boot14 = sum(sample(Dataset$V1, size=X))
Boot15 = sum(sample(Dataset$V1, size=X))
Boot16 = sum(sample(Dataset$V1, size=X))
Boot17 = sum(sample(Dataset$V1, size=X))
Boot18 = sum(sample(Dataset$V1, size=X))
Boot19 = sum(sample(Dataset$V1, size=X))
Boot20 = sum(sample(Dataset$V1, size=X))
Boot21 = sum(sample(Dataset$V1, size=X))
Boot22 = sum(sample(Dataset$V1, size=X))
Boot23 = sum(sample(Dataset$V1, size=X))
Boot24 = sum(sample(Dataset$V1, size=X))
Boot25 = sum(sample(Dataset$V1, size=X))
Boot26 = sum(sample(Dataset$V1, size=X))
Boot27 = sum(sample(Dataset$V1, size=X))
Boot28 = sum(sample(Dataset$V1, size=X))
Boot29 = sum(sample(Dataset$V1, size=X))
Boot30 = sum(sample(Dataset$V1, size=X))
Boot31 = sum(sample(Dataset$V1, size=X))
Boot32 = sum(sample(Dataset$V1, size=X))
Boot33 = sum(sample(Dataset$V1, size=X))
Boot34 = sum(sample(Dataset$V1, size=X))
Boot35 = sum(sample(Dataset$V1, size=X))
Boot36 = sum(sample(Dataset$V1, size=X))
Boot37 = sum(sample(Dataset$V1, size=X))
Boot38 = sum(sample(Dataset$V1, size=X))
Boot39 = sum(sample(Dataset$V1, size=X))
Boot40 = sum(sample(Dataset$V1, size=X))
Boot41 = sum(sample(Dataset$V1, size=X))
Boot42 = sum(sample(Dataset$V1, size=X))
Boot43 = sum(sample(Dataset$V1, size=X))
Boot44 = sum(sample(Dataset$V1, size=X))
Boot45 = sum(sample(Dataset$V1, size=X))
Boot46 = sum(sample(Dataset$V1, size=X))
Boot47 = sum(sample(Dataset$V1, size=X))
Boot48 = sum(sample(Dataset$V1, size=X))
Boot49 = sum(sample(Dataset$V1, size=X))
Boot50 = sum(sample(Dataset$V1, size=X))
Boot51 = sum(sample(Dataset$V1, size=X))
Boot52 = sum(sample(Dataset$V1, size=X))
Boot53 = sum(sample(Dataset$V1, size=X))
Boot54 = sum(sample(Dataset$V1, size=X))
Boot55 = sum(sample(Dataset$V1, size=X))
Boot56 = sum(sample(Dataset$V1, size=X))
Boot57 = sum(sample(Dataset$V1, size=X))
Boot58 = sum(sample(Dataset$V1, size=X))
Boot59 = sum(sample(Dataset$V1, size=X))
Boot60 = sum(sample(Dataset$V1, size=X))
Boot61 = sum(sample(Dataset$V1, size=X))
Boot62 = sum(sample(Dataset$V1, size=X))
Boot63 = sum(sample(Dataset$V1, size=X))
Boot64 = sum(sample(Dataset$V1, size=X))
Boot65 = sum(sample(Dataset$V1, size=X))
Boot66 = sum(sample(Dataset$V1, size=X))
Boot67 = sum(sample(Dataset$V1, size=X))
Boot68 = sum(sample(Dataset$V1, size=X))
Boot69 = sum(sample(Dataset$V1, size=X))
Boot70 = sum(sample(Dataset$V1, size=X))
Boot71 = sum(sample(Dataset$V1, size=X))
Boot72 = sum(sample(Dataset$V1, size=X))
Boot73 = sum(sample(Dataset$V1, size=X))
Boot74 = sum(sample(Dataset$V1, size=X))
Boot75 = sum(sample(Dataset$V1, size=X))
Boot76 = sum(sample(Dataset$V1, size=X))
Boot77 = sum(sample(Dataset$V1, size=X))
Boot78 = sum(sample(Dataset$V1, size=X))
Boot79 = sum(sample(Dataset$V1, size=X))
Boot80 = sum(sample(Dataset$V1, size=X))
Boot81 = sum(sample(Dataset$V1, size=X))
Boot82 = sum(sample(Dataset$V1, size=X))
Boot83 = sum(sample(Dataset$V1, size=X))
Boot84 = sum(sample(Dataset$V1, size=X))
Boot85 = sum(sample(Dataset$V1, size=X))
Boot86 = sum(sample(Dataset$V1, size=X))
Boot87 = sum(sample(Dataset$V1, size=X))
Boot88 = sum(sample(Dataset$V1, size=X))
Boot89 = sum(sample(Dataset$V1, size=X))
Boot90 = sum(sample(Dataset$V1, size=X))
Boot91 = sum(sample(Dataset$V1, size=X))
Boot92 = sum(sample(Dataset$V1, size=X))
Boot93 = sum(sample(Dataset$V1, size=X))
Boot94 = sum(sample(Dataset$V1, size=X))
Boot95 = sum(sample(Dataset$V1, size=X))
Boot96 = sum(sample(Dataset$V1, size=X))
Boot97 = sum(sample(Dataset$V1, size=X))
Boot98 = sum(sample(Dataset$V1, size=X))
Boot99 = sum(sample(Dataset$V1, size=X))
Boot100 = sum(sample(Dataset$V1, size=X))
write.list(data.frame(sum(Boot1), sum(Boot2), sum(Boot3), sum(Boot4), sum(Boot5), sum(Boot6), sum(Boot7), sum(Boot8), sum(Boot9), sum(Boot10), sum(Boot11), sum(Boot12), sum(Boot13), sum(Boot14), sum(Boot15), sum(Boot16), sum(Boot17), sum(Boot18), sum(Boot19), sum(Boot20), sum(Boot21), sum(Boot22), sum(Boot23), sum(Boot24), sum(Boot25), sum(Boot26), sum(Boot27), sum(Boot28), sum(Boot29), sum(Boot30), sum(Boot31), sum(Boot32), sum(Boot33), sum(Boot34), sum(Boot35), sum(Boot36), sum(Boot37), sum(Boot38), sum(Boot39), sum(Boot40), sum(Boot41), sum(Boot42), sum(Boot43), sum(Boot44), sum(Boot45), sum(Boot46), sum(Boot47), sum(Boot48), sum(Boot49), sum(Boot50), sum(Boot51), sum(Boot52), sum(Boot53), sum(Boot54), sum(Boot55), sum(Boot56), sum(Boot57), sum(Boot58), sum(Boot59), sum(Boot60), sum(Boot61), sum(Boot62), sum(Boot63), sum(Boot64), sum(Boot65), sum(Boot66), sum(Boot67), sum(Boot68), sum(Boot69), sum(Boot70), sum(Boot71), sum(Boot72), sum(Boot73), sum(Boot74), sum(Boot75), sum(Boot76), sum(Boot77), sum(Boot78), sum(Boot79), sum(Boot80), sum(Boot81), sum(Boot82), sum(Boot83), sum(Boot84), sum(Boot85), sum(Boot86), sum(Boot87), sum(Boot88), sum(Boot89), sum(Boot90), sum(Boot91), sum(Boot92), sum(Boot93), sum(Boot94), sum(Boot95), sum(Boot96), sum(Boot97), sum(Boot98), sum(Boot99), sum(Boot100)), file=ThePath, row.name=FALSE, col.name=FALSE sep="/r")

I have tried to use write.list and just write but nothing is getting the output I am looking for. I also tried making it into a csv and also space as a sep and they all turn out like this

25026689/r19976650/r13281740/r15783000/r36507540/r15811400/r15799460

or with , or spaces where the /r are.
I am looking for something like this

25026689
19976650
13281740
15783000
36507540
15811400
15799460

I know my code is super bruteforceish and can be done way cleaner and easier with counts and loops but I am still learning most of the coding.

  • 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-14T17:17:51+00:00Added an answer on June 14, 2026 at 5:17 pm

    Your problem is that you are creating a data frame with a single row. In Excel this will be represented in the same way (i.e. one row, instead of one column).

    The solution is to create a single vector that contains your bootstrap values.

    This is the perfect time to get acquainted with sapply or its close cousin replicate:

    boot <- data.frame(
      boot = replicate(100, sum(runif(100)))
    )
    head(boot)
          boot
    1 50.84482
    2 49.57098
    3 52.75195
    4 52.20751
    5 48.55071
    6 50.76622
    

    Easy, isn’t it?


    Now your code turns into:

    Dataset <- read.table("clipboard", header=FALSE, sep="", na.strings="", 
                          dec=".", strip.white=TRUE)
    ThePath <-  ""
    #Replace with where you want it to save
    P <- .25
    #Put the Percentage Value you want to use here
    X <- round(nrow(Dataset)*P)
    
    
    boot <- data.frame(
      boot = replicate(100, sum(sample(Dataset$V1, size=X)))
    )
    write.csv(boot, file=="your_file_name", row.names=FALSE)
    

    Disclaimer: untested – I don’t have your data

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

Sidebar

Related Questions

I'm having a system that collects real-time Apache log data from about 90-100 Web
i came across a sample gdbinit file, which was having following statements. can anyone
I have a C++ program that will read in data from a binary file
I've having issues with parsing JSON data from a php file through to JQuery.I've
This is a strange problem I'm having, I've downloaded the WebSharingAppDemo sample from Microosfts
I guess that I am missing something here. After having found this sample within
I have a file log that I would like to parse and am having
I'm trying to create a mysql table from a thesaurus text file I got
I am having difficulties subtracting data from the same column. My data structure looks
So I'm trying to pull some data from two text files. The first loads

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.