Why is my command not working in RStudio?

0

I have a problem with a command in RStudio. When I execute the command, RStudio offers "+" at a line, clearly waiting for more, but I don´t know about that. The command below is to set nominal variables for a dataset. Interesting that if i put 119 variables, it works, but if i put more then this, it´s not work. Could anybody help me please?

noms=c("Sex_v0005","SpanishLatinoHispanic_v0018","Descent","Race","RaceBlackNonBlack_v0045","USBorn_v0046","Citizen_v0051","USCitizen_v0052","DualUSCitizen_v0057","Marital_v0058","USMilitaryService_v0059","ServiceAF","CurrentlySentencedServeTime_v0083","AwaitingJudicialResolution_v0085","HeldOtherAuthorities_v0090","HeldSafekeeping_v0091","HeldAnotherReason_v0092","1stOffense_v0115","2ndOffense_v0117","3rdOffense_v0119","4thOffense_v0121","5thOffense_v0123","MonthAdmission_v0129","AdmissionPrecedesArrest_v0134","v1057_ATARREST-RESIDENCE STATE","SentencedHow_v1693","InstitutionSentenced_v1694","MonthFirstAdmitted_v1695","MonthReleased_v1704","BefAdmissionHighGrade_v1740","CompletedThatYear_v1741","GEDEarned_v1742","GEDOrHighSchoolDiploma_v1743","GEDEarnedWhileServing_v1744","DuringMonthBefArrestHadJobOrBusiness_v1747","FullPartOrOccasionalWork_v1748","BefArrestEverHomeless_v1778","AnyChildren_v1810","SinceAdmissionMadeReceiveCallsChildren_v1843","SinceAdmissionSentOrReceiveMailChildren_v1844","VisitedByChildren_v1845","GroupRelativeSentencedAndServedJail","WhileGrowingUpHaveFriendsDoingSomethingWrong","ParticipatedInAnyOfTheseActivities_v1891","BefAdmissionAnyonePressuredYouSexualContact_v1897","SexualContactsAgainstYour_v1914","AnyIncidentsTakePlaceWhileIncarcerated_v1921","BefAdmissionPhysicallyAbused_v1935","DrunkAlcoholicBeveragesMoreOnceAWeekMoreThanMonth_v1984","InYearBefOffenseDrinkAnyAlcohol_v1985","DuringThatYearHowOftenDrinkAlcohol_v1986","DrinkingAnyAlcoholAtTimeOffense_v1987","EverUsedHeroin_v2050","EverUsedOtherOpiates_v2051","EverUsedMethamphetamine_v2052","EverUsedOtherAmphetamine_v2053","EverUsedMethaqualone_v2054","EverUsedBarbiturates_v2055","EverUsedTranquilizers_v2056","EverUsedCrack_v2057","EverUsedCocaine_v2058","EverUsedPCP_v2059","EverUsedEcstasy_v2060","EverUsedLSD_v2061","EverUsedMarijuanaHashish_v2062","EverUsedAnyOtherDrugs_v2063","EverInhaledSubstancesToGetHigh_v2064","EverUsedOtherOpiates_v2069","EverUsedMethamphetamineOnceAWeekForAMonth_v2073","EverUsedOtheAmphetamineOnceAWeekForAMonth_v2077","EverUsedMethaqualoneOnceAWeekOrMoreLeastAMonth_v2081","EverUsedBarbituratesOnceAWeekOrMoreLeastAMonth_v2085","EverUsedTranquilizersOnceAWeekOrMoreLeastAMonth_v2089","EverUsedCrackOnceAWeekOrMoreLeastAMonth_v2093","EverUsedCocaineOnceAWeekOrMoreLeastAMonth_v2097","EverUsedPCPOnceAWeekOrMoreLeastAMonth_v2101","EverUsedEcstasyOnceAWeekOrMoreLeastAMonth_v2105","EverUsedLSDOrOtherOnceAWeekOrMoreLeastAMonth_v2109","EverUsedMarijuanaOnceAWeekOrMoreLeastAMonth_v2113","EverUsedAnyOtherDrugsOnceAWeekOrMoreLeastAMonth_v2117","EverInhaledSubstancesToGetHighOnceAWeekOrMoreLeastAMonth_v2121","EverAttendedDrugTreatmentProgram_v2188","SinceAdmissionUsedOutpatientCounseling_v2215","ForProblemsWithAlcoholDrugsOrBoth_v2216","SinceAdmissionUsedSelfHelpGroup_v2223","SinceAdmissionUsedEducationOrAwarenessProgram_v2231","SinceAdmissionUsedMaintenanceDrugToCutHigh_v2239","SinceAdmissionUsedAnyOtherProgram_v2247","AtAdmissionCheckForSickInjuryOrIntoxication_v2269","AtAdmissionQuestionedAboutHealth_v2270","AtAdmissionQuestionedAboutSuicide_v2271","AtAdmissionTakingPrescribedMedication_v2272","AfterAdmissionContinuedTakingMedication_v2273","SinceAdmissionTestTB_v2274","TestResultTB_v2275","GivenPillsBecausePositiveTBTest_v2276","ToldTBResult_v2277","SinceAdmissionHadMedicalExamination_v2278","SinceAdmissionHadPelvicExamination_v2279","MonthLastPelvicExamination_v2280","WhenAdmittedPregnant_v2284","ReceivedObstatricExamination_v2285","ReceivedAnyOtherMedicalCare_v2286","SinceAdmissionBloodTest_v2287","HIVTested_v2288","ResultOfLastTest_v2289","EverHIVTested_v2290","ResultOfLastTest_v2291","SinceAdmissionIntentionallyInjured_v2292","EverDiagnosedAnyMentalOrEmotionalCondition","EverReceivedCounselingTrainedProfessional_v2417","ReceivedCounselingSinceAdmission_v2419","EverReceivedOtherMentalTreatment_v2420","EverAttemptedSuicide_v2423","EverConsideredSuicide_v2425","DifficultySeeingNewsprintEvenWithGlasses_v2427","DifficultyHearingConversationEvenWithHearingAid_v2428","LearningDisability_v2429","SpeechImpairment_v2430","UseAidsHelpWithDailyActivities_v2431","EnrolledInSpecialEducationClasses_v2432","ConsiderYourselfHaveDisability_v2433","SpentTimeInPhysicalExerciseLast24Hours_v2436","TVAvailableInPrison_v2439","WatchAnyTVLast24Hours_v2440","NewspapersMagazinesBooksAvailable_v2443","SpentAnyTimeReadingLast24Hours_v2444","SpendAnyTimeOtherRecreationLast24Hours_v2447","EngagedAnyReligiousActivities_v2450","TelephoneFriendsAndFamily_v2453","VisitsLastMonth_v2455","AllowedHaveVisits_v2457","WorkAssignmentOffPrisonGrounds_v2458","WorkAssignment_v2473","ReceiveGoodTimeTimeCredits_v2492","SinceAdmissionAnyVocationalOrJobTrainingProgram_v2498","StillInVocationalOrJobTrainingProgram_v2499","SinceAdmissionAnyOtherEducationProgram_v2500","SinceAdmissionCompletedGED_v2508","ParticipatedInActivities","GivenFurloughOrDayPass_v2565","GivenFurloughOrDayPass_MultiSelectGroup_v2567","GivenFurloughOrDayPass_MultiSelectGroup_v2568","GivenFurloughOrDayPass_MultiSelectGroup_v2569","GivenFurloughOrDayPass_MultiSelectGroup_v2570","GivenFurloughOrDayPass_MultiSelectGroup_v2571","TypeOfOffenses_v2597","PriorProbation_v2598","PriorIncarceration_v2599","UsedAlcohol_v2600","UsedDrugs_v2601","VeteranStatus_v2602","v2982_RACEANDHISPANICORIGINOFINMATE","WrittenUpOrFoundGuiltyOfBreakingAnyRules_v2517")

1 Like

Interesting, if you only try to run portions of that vector, the issue only arises with the 120th value.
But there's nothing special about that value.

I can replicate this issue in RStudio Version 1.2.1335, but the bug doesn't show up on R.

1 Like

There an open GitHub issue here that may be related to yours (but appears to be unsolved).

2 Likes

This is as documented: the maximum line length for console input is 4095 bytes.

https://cran.r-project.org/doc/manuals/R-intro.html#R-commands_003b-case-sensitivity-etc

Thanks Guys, I changed the input and it worked.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.