This question already has answers here:
long/bigint/decimal equivalent datatype in R
(7 answers)
Closed 3 years ago.
I am assigning a large odd number to a variable (1126605209290117121) and it is being shown as (1126605209290117120) [observe the last digit] in the environment. But assigning a large even number is represented correctly. Can someone explain why?
a = 1126605209290117121
print(as.character(a))
[1] "1126605209290117120"
After searching through the internet I learned that R still has only 32-bit integers.
This blog post in R Bloggers summarises the problem clearly
Related
This question already has answers here:
Reasons for using the set.seed function
(7 answers)
Different Set.seed sample function results with same versions of R in different OS
(2 answers)
Closed 10 months ago.
This post was edited and submitted for review 10 months ago and failed to reopen the post:
Original close reason(s) were not resolved
How can different users obtain the same randomly generated matrix with rbinom assigning (0/1) in r?
Here's the applied code
data <- matrix(rbinom(30*6, 1, prior), 30, 6)
I've tried set.seed() but it just generates similar results for me but different for other users
This question already has answers here:
Why aren't these various encodings allowing me to properly display Portuguese?
(2 answers)
Closed 1 year ago.
When I first wrote my script, letters such as 'ç' and 'ã - very commonly used in portuguese - were fine. So if I wrote, for example, the word 'vagão' in portuguese, that's how it would read it. But when I reopened the project with that script, it reads "vagão". How do I fix it?
You must be looking at encoding issues or conversion issues due to encoding on Windows(assuming that you're using windows). This might give you your answer.
This question already has answers here:
Factors in R: more than an annoyance?
(8 answers)
Closed 5 years ago.
I am new to R language and am not able to understand the need to use/have Factors in R and its killing me. I read a lot but still have not found the satisfactory answer. Any help would be much appreciated. Thank you.
It is a way to associate numbers to different values of a categorical variable.
Let's say you have a vector of genders, and you wish to introduce it to some model (lm for example). Then you need to code the values (0/1 perhaps). Here you will use factor on the vector of genders
This question already has answers here:
Show names of everything in a package
(4 answers)
Closed 9 years ago.
My question is similar to this question and in fact, is answered there. But because it took me a lot effort to find the answer there. I preferred to create a new more organized one and answer it myself.Now the question is:
If I want to see all methods, dataframes, etc of a package that I only know its name, what should I do to access them very easily?
Just enter this code:
help(package='PACKAGENAME', help_type='html')
for example to see all you have in the R basic package, stats:
help(package='stats',help_type='html')
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Number format, writing 1e-5 instead of 0.00001
How to not display number as exponent?
I am using RStudio and have a problem that I could not find any solution for:
When working with very large numbers, R displays those number in a shorter format.
But when calculating (for example) (2000x1000x2000), I really want to see 4000000000 and not 4e+09.
How can I change that behaviour?