Rakish Audacity can be used if you don't have disadvantage with ranged weapon attacks within 5 feet.
From the Swashbuckler rogue archetype (XGtE, p. 47):
You also gain an additional way to use your Sneak Attack; you don’t need advantage on the attack roll to use your Sneak Attack against a creature if you are within 5 feet of it, no other creatures are within 5 feet of you, and you don’t have disadvantage on the attack roll. All the other rules for Sneak Attack still apply to you.
Thus a Swashbuckler rogue can make a sneak attack if one (or more) of the following conditions are met:
You're using a finesse or ranged weapon, and you have advantage on the attack roll.
You're using a finesse or ranged weapon, and another enemy of the target is within 5 feet of it, and that enemy isn’t incapacitated, and you don’t have disadvantage on the attack roll.
You're using a finesse or ranged weapon, and you're within 5 feet of the target, and no other creatures are within 5 feet of you, and you don't have disadvantage on the attack roll.
Normally, when you make a ranged attack against a creature within 5 feet, the attack roll has disadvantage, which doesn't work with Rakish Audacity.
Aiming a ranged attack is more difficult when a foe is next to you. When you make a ranged attack with a weapon, a spell, or some other means, you have disadvantage on the attack roll if you are within 5 feet of a hostile creature who can see you and who isn't incapacitated.
However, if you have some way of making a ranged attack within 5 ft without disadvantage, then you could use Rakish Audacity using that way.
For example, characters with the Crossbow Expert feat (PHB, p. 165) don't have disadvantage on ranged attacks against a hostile target within 5 feet.
Being within 5 feet of a hostile creature doesn't impose disadvantage on your ranged attack rolls.
This benefit applies to any ranged attack, as Sage Advice confirms:
The second benefit of Crossbow Expert prevents you from suffering that disadvantage, whether or not the ranged attack is with a crossbow.
So if you have Crossbow Expert, and the other conditions for Rakish Audacity (5 feet from your target and no other creatures within 5 feet of you) are met, then your ranged attack qualifies for Sneak Attack.