Simulating data using fakeR in R
up vote
0
down vote
favorite
I have a data frame named "data" with 74 variables/columns and 1751 observations/rows. I am attempting to use the fakeR library to simulate 1000 rows of fake data based on this existing data frame I have.
I have tried using
simulated_data <- simulate_dataset(data);
but keep getting
Error in table...attempt to make a table with >=2^31 elements
I have also tried to manually enter each variable into a data frame (suggested previously on a question from some other issue) but have gotten the same error. Like so,
df <- data.frame(data);
df$VARIABLE_NAME <- as.character(data$VARIABLE_NAME);
I'm really new to R and am struggling immensley. I could really use and appreciate any help. Thanks so much!
r faker
|
show 7 more comments
up vote
0
down vote
favorite
I have a data frame named "data" with 74 variables/columns and 1751 observations/rows. I am attempting to use the fakeR library to simulate 1000 rows of fake data based on this existing data frame I have.
I have tried using
simulated_data <- simulate_dataset(data);
but keep getting
Error in table...attempt to make a table with >=2^31 elements
I have also tried to manually enter each variable into a data frame (suggested previously on a question from some other issue) but have gotten the same error. Like so,
df <- data.frame(data);
df$VARIABLE_NAME <- as.character(data$VARIABLE_NAME);
I'm really new to R and am struggling immensley. I could really use and appreciate any help. Thanks so much!
r faker
Perhaps this sort of task could just as easily be accomplished using the standard R library?x <- matrix(rnorm(74 * 1751, 100, 50), 74, 1751)
will give you a matrixx
that has the dimensions you specified, and the values are just random draws from the normal distribution with mean = 100 and sd = 50. You can always convert it to a dataframe by passing it toas.data.frame()
. If you need fake string values, one easy way is to use all sorts of permutations of the built-in letter vectorsletters
andLETTERS
– 12b345b6b78
Nov 10 at 21:46
What classes are your df and columns?
– iod
Nov 10 at 23:05
@12b345b6b78 how could I get it to create random data based on data i already have? I am fetching a table in from SQL
– XGingerDictator
Nov 12 at 1:07
@iod I'm not sure I understand what you mean
– XGingerDictator
Nov 12 at 1:07
Can you provide the str() for your df?
– iod
Nov 12 at 1:16
|
show 7 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a data frame named "data" with 74 variables/columns and 1751 observations/rows. I am attempting to use the fakeR library to simulate 1000 rows of fake data based on this existing data frame I have.
I have tried using
simulated_data <- simulate_dataset(data);
but keep getting
Error in table...attempt to make a table with >=2^31 elements
I have also tried to manually enter each variable into a data frame (suggested previously on a question from some other issue) but have gotten the same error. Like so,
df <- data.frame(data);
df$VARIABLE_NAME <- as.character(data$VARIABLE_NAME);
I'm really new to R and am struggling immensley. I could really use and appreciate any help. Thanks so much!
r faker
I have a data frame named "data" with 74 variables/columns and 1751 observations/rows. I am attempting to use the fakeR library to simulate 1000 rows of fake data based on this existing data frame I have.
I have tried using
simulated_data <- simulate_dataset(data);
but keep getting
Error in table...attempt to make a table with >=2^31 elements
I have also tried to manually enter each variable into a data frame (suggested previously on a question from some other issue) but have gotten the same error. Like so,
df <- data.frame(data);
df$VARIABLE_NAME <- as.character(data$VARIABLE_NAME);
I'm really new to R and am struggling immensley. I could really use and appreciate any help. Thanks so much!
r faker
r faker
asked Nov 10 at 21:40
XGingerDictator
1
1
Perhaps this sort of task could just as easily be accomplished using the standard R library?x <- matrix(rnorm(74 * 1751, 100, 50), 74, 1751)
will give you a matrixx
that has the dimensions you specified, and the values are just random draws from the normal distribution with mean = 100 and sd = 50. You can always convert it to a dataframe by passing it toas.data.frame()
. If you need fake string values, one easy way is to use all sorts of permutations of the built-in letter vectorsletters
andLETTERS
– 12b345b6b78
Nov 10 at 21:46
What classes are your df and columns?
– iod
Nov 10 at 23:05
@12b345b6b78 how could I get it to create random data based on data i already have? I am fetching a table in from SQL
– XGingerDictator
Nov 12 at 1:07
@iod I'm not sure I understand what you mean
– XGingerDictator
Nov 12 at 1:07
Can you provide the str() for your df?
– iod
Nov 12 at 1:16
|
show 7 more comments
Perhaps this sort of task could just as easily be accomplished using the standard R library?x <- matrix(rnorm(74 * 1751, 100, 50), 74, 1751)
will give you a matrixx
that has the dimensions you specified, and the values are just random draws from the normal distribution with mean = 100 and sd = 50. You can always convert it to a dataframe by passing it toas.data.frame()
. If you need fake string values, one easy way is to use all sorts of permutations of the built-in letter vectorsletters
andLETTERS
– 12b345b6b78
Nov 10 at 21:46
What classes are your df and columns?
– iod
Nov 10 at 23:05
@12b345b6b78 how could I get it to create random data based on data i already have? I am fetching a table in from SQL
– XGingerDictator
Nov 12 at 1:07
@iod I'm not sure I understand what you mean
– XGingerDictator
Nov 12 at 1:07
Can you provide the str() for your df?
– iod
Nov 12 at 1:16
Perhaps this sort of task could just as easily be accomplished using the standard R library?
x <- matrix(rnorm(74 * 1751, 100, 50), 74, 1751)
will give you a matrix x
that has the dimensions you specified, and the values are just random draws from the normal distribution with mean = 100 and sd = 50. You can always convert it to a dataframe by passing it to as.data.frame()
. If you need fake string values, one easy way is to use all sorts of permutations of the built-in letter vectors letters
and LETTERS
– 12b345b6b78
Nov 10 at 21:46
Perhaps this sort of task could just as easily be accomplished using the standard R library?
x <- matrix(rnorm(74 * 1751, 100, 50), 74, 1751)
will give you a matrix x
that has the dimensions you specified, and the values are just random draws from the normal distribution with mean = 100 and sd = 50. You can always convert it to a dataframe by passing it to as.data.frame()
. If you need fake string values, one easy way is to use all sorts of permutations of the built-in letter vectors letters
and LETTERS
– 12b345b6b78
Nov 10 at 21:46
What classes are your df and columns?
– iod
Nov 10 at 23:05
What classes are your df and columns?
– iod
Nov 10 at 23:05
@12b345b6b78 how could I get it to create random data based on data i already have? I am fetching a table in from SQL
– XGingerDictator
Nov 12 at 1:07
@12b345b6b78 how could I get it to create random data based on data i already have? I am fetching a table in from SQL
– XGingerDictator
Nov 12 at 1:07
@iod I'm not sure I understand what you mean
– XGingerDictator
Nov 12 at 1:07
@iod I'm not sure I understand what you mean
– XGingerDictator
Nov 12 at 1:07
Can you provide the str() for your df?
– iod
Nov 12 at 1:16
Can you provide the str() for your df?
– iod
Nov 12 at 1:16
|
show 7 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243676%2fsimulating-data-using-faker-in-r%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Perhaps this sort of task could just as easily be accomplished using the standard R library?
x <- matrix(rnorm(74 * 1751, 100, 50), 74, 1751)
will give you a matrixx
that has the dimensions you specified, and the values are just random draws from the normal distribution with mean = 100 and sd = 50. You can always convert it to a dataframe by passing it toas.data.frame()
. If you need fake string values, one easy way is to use all sorts of permutations of the built-in letter vectorsletters
andLETTERS
– 12b345b6b78
Nov 10 at 21:46
What classes are your df and columns?
– iod
Nov 10 at 23:05
@12b345b6b78 how could I get it to create random data based on data i already have? I am fetching a table in from SQL
– XGingerDictator
Nov 12 at 1:07
@iod I'm not sure I understand what you mean
– XGingerDictator
Nov 12 at 1:07
Can you provide the str() for your df?
– iod
Nov 12 at 1:16