Similar random results for different users [duplicate] - r

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

Related

How to parse all variables in R? [duplicate]

This question already has answers here:
Make list of objects in global environment matching certain string pattern
(1 answer)
R: Put Variables from .GlobalEnv, that meet certain criteria in list
(2 answers)
Closed 3 months ago.
in python to parse all the variables that have a name ending for example with "_df"
I would use something similar to what I found here. How to do a similar thing in R?
Namely, I have several variables ending with _df and I have to do some actions to these.
Thanks

How many observations of a variable are missing? [duplicate]

This question already has answers here:
Determine the number of NA values in a column
(17 answers)
Closed 2 years ago.
Here is the data that I am using :
https://www.dropbox.com/s/dl/chmzqmus6bfoaim/climate_clean.csv
I want to know how many observations of the variable average_temperature_celsius are missing
But I don't know how to do it, please could you help me
loaded your data in a variable called climate
sum(is.na(climate$average_temperature_celsius))

Having issues with large numbers in R [duplicate]

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

I want to compare two datasets to determine which variables they share [duplicate]

This question already has answers here:
How to find common elements from multiple vectors?
(3 answers)
Closed 5 years ago.
I have two RNAseq read-outs for two groups and would like to compare them. These data appear as a gene and a value. I would like to determine which genes are shared between the two datasets but they are very large and doing this manually will take a long time. Thanks!
Use
intersect(genes1, genes2)
and look up the help page for other related and useful functions.

How to display numbers in a human readable format? [duplicate]

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?

Resources