0

I have an excel file with a table, which I transformed into a txt file. I try to upload this table to R using: df = read.table("nameofmyfile.txt", header = TRUE)

I've searched in multiple websites and they all referred this formula. Also, I made sure that the directory I want is the correct. However, when I use the formula the data simply don't appear (there is no error though). Wasn't the table supposed to appear?

Also, I will use these data to do a random sampling without replacement with weights. If anyone can help me with a pipeline for such would be amazing.

Pang
  • 9,564
  • 146
  • 81
  • 122
  • the data doesn't appear because it is asigned to the variable `df`. The command `df` should display the data – etienne Oct 24 '16 at 21:06
  • As for the sampling with weights, just use `sample`. You can see the help of the function by typing `?sample` or `help(sample)`. You will have to specify some options : `replace = FALSE` (by default) and the values for `prob` – etienne Oct 24 '16 at 21:08
  • Thanks :) I knew the solution was simple – João Santos Oct 24 '16 at 21:12

0 Answers0