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

  • Home
  • SEARCH
  • 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 8574021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:22:55+00:00 2026-06-11T19:22:55+00:00

In a file I’ve got there is for a list of parameters the following

  • 0

In a file I’ve got there is for a list of parameters the following string set where a 0=false and a 1=true. I can create some simple script that cuts up the string in chars and then per char define set a vector with trues/falses but was wondering if there is no such functionality available by default in the base package or maybe a CRAN package.

Example bit string:
00000000000000000000100000001000000000000000000000000000000000000001

Strings can be long and I’ll have to parse loads of them so it would be great to see if there is some function that can do this with decent speed 🙂

  • 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-11T19:22:56+00:00Added an answer on June 11, 2026 at 7:22 pm

    If you can be assured that all the characters will be 0s or 1s, this should be fast:

    x <- "00000000000000000000100000001000000000000000000000000000000000000001"
    charToRaw(x) == charToRaw("1")
    #  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    # [13] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE
    # [25] FALSE FALSE FALSE FALSE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    # [37] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    # [49] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
    # [61] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
File file = new File(/WEB-INF/view/skin/outlogin); String[] directories = file.list(new FilenameFilter() { @Override public boolean
/** @file ListP.cpp * ADT list - Pointer-based implementation. */ #include <iostream> #include <cstddef>
File lstFile = new File(lstFileName).withWriter{out-> archivedFiles.each {out.println it.name} } archivedFiles is a List objects
File.Exists is returning false when the file actually exists. I know it would return
File.isFile() and File.isDirectory() both return false not only when the File is not the
FILE : hello world foo bar How can I remove all the empty new
file:///home/ashu/Music/Collections/randomPicks/ipod%20on%20sep%2009/Coldplay-Sparks.mp3 How can I convert a string like the above to get the normal
File: C:\Some\Location\index I just want to replace \index with \example echo preg_replace('/[\\\|\/]{1}.*?$/', '\example', $file);
File dir = Environment.getExternalStorageDirectory(); if (dir.exists() && dir.isDirectory()) { String exStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath(); File

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.