32-bit binary string conversion from string to integer fails. See below
strtoi("10101101100110001110011001111111", base=2)
# [1] NA
Any ideas what the problem might be ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
It looks like
strtoicannot handle numbers greater than2^31:which is the maximum integer my machine (and probably yours) can handle for an integer:
Note that the documentation does warn about overflow (from
?strtoi):What you can do is write your own function that returns the output as a numeric instead of an integer: