r - Resampling overlap between two lists -


I have two .txt files. Both files are a list of strings, like one with a string per line.

  GRIM1 PHOXA2 SLITRK4   

Both text files are ~ 20,000 rows long I randomly want to sample file 2 to 500 string with file 1 and 700 string Am Then I want to calculate the number of stars that overlap these subsets.
Then I repeat this process 100 times and want to calculate the minimum, the maximum and the number of strings which means that 100 recompiling overlaps these subsets.

I was trying to customize some code that used to work for similar tasks but I get an error: sample.int (length (x), size, replace , Pro): When the 'replacement = false'

was the code: CSV (file = "file1wt", header = F) list B & lt; - read.csv (file = "file2.txt", header = F) list A & lt; - as.character (listA) # To check that you actually have a vector of gene names # that is, you must do: List A & L; - as.character (listA) listB & lt; - as.character (listB) res & lt; - Representative (NA, 100) Jean Todra & lt; - 500 # How many people to choose jeans Toddda 2 & lt; - 700 # If you want to get a different number from the second list (i in 1: the length of the race) {drawA & lt; - Sample (x = listA, size = genesToDraw, replace = FALSE) drawB & Lt; - Sample (x = listB, size = genosotr 2, replacement = FALSE) # or size = gentodra2 ridge [i] & lt; - Maximum (Race) Yoga (RAS> 5) # How often do I

help you Thanks in advance and please tell me that I should clarify.

When I run the listA and run dput (listB) after the ascharacter part of the code I get a group of separate numbers from commas as commas, here is a subset:

  1100, 4576, 7394, 1343, 4997, 13807, 1233, 9580, 15254, 10466, 3333, 622, 11177, 4067, 4800, 75 9 2, 5363, 9646, 11213, 14314 , 2475, 838 9, \ n 12559, 12808, 5248, 10423, 7856, 12 9 76, 969, 1674, 20 9 0, 9 369, 1209, 1352, 1218, 7966, 694, 4088, 623, 4768, 2002, 11776, 14710, 5502, 6212, 7300, 2123, 7194, 2128, 1683, 149, 4491, 2672, 10275, 9424, 997, 15506, 14307, 2644, 11508, 9272 , 5107, 10146, 11693, 1802, 652, 13073, 4268, 5435, 718, 4845   

Best regards,

ruble / Div>

As we have discussed, first when you are expecting strings, the strings AFFactors flag in read.csv calls Set a false so that you do not mess with the factors

  listA & lt; - read.csv (file = "file1.txt", header = FALSE, stringsfactors = FALSE) listB & lt; - read.csv (file = "file2.txt", header = FALSE, stringsfactors = FALSE)   

You will now have two data frames, each with one column, of the character objects Will be Sample function requires a vector, so we have a column dataframe for

  listA < -listA [, 1] listB & lt; -listB [, 1]   

and you should get your code to run it!

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -