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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:58:19+00:00 2026-06-12T21:58:19+00:00

I have a table in a file with many rows which I have read

  • 0

I have a table in a file with many rows which I have read into R using

data <-read.table("path/to/data.txt",header=TRUE, sep="\t",row.names=1)
            A1    A2    A3    B1    B2    B3
    Row1    1      3    2     3     2     6    
    Row2    3      2    1     3     6     7
    ...

I have then read this into a frame using

df <-data.frame(data)

I would like to perform a function() to compare the A samples against the B samples for each row,

function(A,B)

but I am unsure how to specify only the A’s and only the B’s from the data frame for each row – is there a way to do this all at once for the whole data table? Do I have to read the data into a frame or can I work straight from the initial read.table data?

  • 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-12T21:58:20+00:00Added an answer on June 12, 2026 at 9:58 pm

    Try this:

    set.seed(001) # Generating some data
    DF <- data.frame(A1=sample(1:9, 10, T),
                     A2=sample(1:9, 10, T),
                     A3=sample(1:9, 10, T),
                     B1=sample(1:9, 10, T),
                     B2=sample(1:9, 10, T),
                     B3=sample(1:9, 10, T))
    
    
    sampA <- DF[,grep('A', names(DF))]  # Sample with columns A
    sampB <- DF[,grep('B', names(DF))]  # Sample with columns B
    
    
    lapply(1:nrow(DF), function(i){
      wilcox.test(as.numeric(sampA[i,]), as.numeric(sampB[i,]), exact=FALSE )
    })  # Performing the test
    

    The result looks like this:

    [[1]]
    
        Wilcoxon rank sum test with continuity correction
    
    data:  as.numeric(sampA[i, ]) and as.numeric(sampB[i, ]) 
    W = 3, p-value = 0.6579
    alternative hypothesis: true location shift is not equal to 0 
    
    
    [[2]]
    
        Wilcoxon rank sum test with continuity correction
    
    data:  as.numeric(sampA[i, ]) and as.numeric(sampB[i, ]) 
    W = 0, p-value = 0.0722
    alternative hypothesis: true location shift is not equal to 0 
    
    
    [[3]]
    
        Wilcoxon rank sum test with continuity correction
    
    data:  as.numeric(sampA[i, ]) and as.numeric(sampB[i, ]) 
    W = 6, p-value = 0.6579
    alternative hypothesis: true location shift is not equal to 0 
    

    I only showed the first 3 results, the complete list length is 10 since DF has 10 rows.

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

Sidebar

Related Questions

I have a web page which has many divs (listed like table rows), and
I have a table in C#, the data is coming from an Excel file.
I have a huge access mdb file which contains a single table with 20-30
I'm loading a CSV file containing many thousands of rows into a .NET DataTable
I have a text file with data which might look something like: UserName Address
I've configured a db w/ a FileStream group and have a table w/ File
I have table nol_voa with different values and I am importing xml file with
I have a table and a text file. Once the records in the table
I have a batch file that runs several python scripts that do table modifications.
I need to export a Table into a CSV File and serve it to

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.