Generation of a magnetic island by edge turbulence in tokamak plasmas