Re: [R] Help merging large datasets in R

2025-05-07 Thread Jeff Newmiller via R-help
> Variable names cannot have spaces Please soften your words... variables can have all sorts of characters including spaces in them, but it can be inconvenient to quote them all with back-tick quotes like `merged 1` so where possible most people avoid variable names with weird characters. Peop

Re: [R] Help merging large datasets in R

2025-05-07 Thread Ebert,Timothy Aaron
Some issues: 1) Variable names cannot have spaces. "merged 1" is not valid but "merged_1" is a valid alternative. 2) You need to tell R what to merge by. It looks like you may be using data tables rather than a data frame. merged <- dataset2[dataset1, on = "id", nomatch = NA] 3) Alternatively: j

[R] Help merging large datasets in R

2025-05-07 Thread Deelen, M. (Mirjam) via R-help
Hi guys, For my MSc. thesis i am using R studio. The goal is for me to merge a couple (6) of relatively large datasets (min of 200.000 and max of 2mil rows). I have now been able to do so, however I think something might be going wrong in my codes. For reference, i have a dataset 1 (200.000), da

Re: [R] How to get the same result for GA optimization?

2025-05-07 Thread Daniel Lobo
Hi, Before calling the second ga, I am just altering the columns of dat except the first column Dat = Dat[, c(1, 1 + sample(1:30, 30, replace = F))] With that, I expect the positions of the elements of x will be changed, but objective function should return the same value, same for ga. Below is

Re: [R] How to get the same result for GA optimization?

2025-05-07 Thread Michael Dewey
Dear Daniel As far as I can see you have re-generated the data before calling ga() so the data is not just a permutation of the first set. Michael On 07/05/2025 15:36, Daniel Lobo wrote: I am using *Genetic Algorithm* to maximize some function which use data. I use GA package in R for this

[R] How to get the same result for GA optimization?

2025-05-07 Thread Daniel Lobo
I am using *Genetic Algorithm* to maximize some function which use data. I use GA package in R for this ( https://cran.r-project.org/web/packages/GA/index.html) Below is my code library(GA) set.seed(1) Dat = data.frame(rnorm(1000), matrix(rnorm(1000 * 30), nc = 30)) Fitness_Fn = function(x) {