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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:32:08+00:00 2026-05-27T05:32:08+00:00

INPUT specimens : character vector of 60 items: specimen1A, specimen1B, specimen2A … specimen 30B

  • 0

INPUT

  1. specimens: character vector of 60 items: specimen1A, specimen1B, specimen2A ... specimen 30B.

DESIRED OUTPUT

  1. A matrix or a dataframe in which each item in specimens is the name of a column in the matrix/dataframe.
  2. The number of rows must be set to a fixed value (any).
  3. The data for the cells will be filled with subsequent code so can be left as NA.

For example:

   specimen1A  specimen1B specimen2A ... specimen 30B
1   NA          NA              NA         NA
2   NA          NA              NA         NA
3   NA          NA              NA         NA
..  ..          ..              ..         ..
100 NA          NA              NA         NA

Thanks

  • 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-05-27T05:32:09+00:00Added an answer on May 27, 2026 at 5:32 am

    A data.frame is just a list with some added attributes. Just coerce it:

    > specimens <- list(A=runif(10),B=runif(10))
    > 
    > as.data.frame(specimens)
               A         B
    1  0.6746436 0.7599987
    2  0.2198677 0.5004017
    3  0.4927745 0.9455003
    4  0.8028011 0.8718274
    5  0.6190707 0.7415874
    6  0.5273992 0.8118802
    7  0.6602548 0.4432799
    8  0.5820781 0.8117375
    9  0.8196531 0.5172833
    10 0.0683938 0.0205693
    

    Edit: Re-reading your problem, I suspect specimens is a character vector not really a list. If so:

    N.rows <- 10
    specimens <- c("A","B")
    spec.dat <- as.data.frame(matrix(NA,nrow=N.rows,ncol=length(specimens)))
    colnames(spec.dat) <- specimens
    
    > spec.dat
        A  B
    1  NA NA
    2  NA NA
    3  NA NA
    4  NA NA
    5  NA NA
    6  NA NA
    7  NA NA
    8  NA NA
    9  NA NA
    10 NA NA
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Input: I have a LaTeX file, with plain text & math formulas. Desired output:
Input: total cost. Output: all the combinations of levels that give the desired cost.
Input : {5, 13, 6, 5, 13, 7, 8, 6, 5} Output : {5,
Input: SHC 111U,SHB 22x,, SHA 5555G Needed output: SHB 22X, SHC 111U, SHA 5555G
Input col1, col2, col3, coln Output @col1, @col2, @col3, @coln
Input: var str = 'text {{value1}} text {{value2}}text{{value1}}'; Regex: var result = str.match(/({{\S+}})+/ig); Output:
Input: Hi. I am John. My name is John. Who are you ? Output:
input: name <hui.li@xxx.ch>; hans@dhdfhgdfgh <hans.dampf@xxxx>; Output: e1@mail.com, e2@mail.com, e3@mail.com,e@mail.com I want to erase the
Input: a maze represented by an arbitrarily sized matrix of bools. (Out of bounds
Input: df -k Output: Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t0d0s0 10332220 443748

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.