为什么向量超过约400个分量时会失败?

时间:2019-03-25 18:20:44

标签: r

我正在写要在R包“ patternize”中使用的文件名列表(或更确切地说,向量)。但是,向量函数c()在300个以上的组件中无法正常工作。

这可以正常工作,并在命令窗口中返回>(按预期方式):

IDList <- c('199006_V','199007_V','199008_V','199009_V','199010_V','199011_V','199013_V','199014_V','199015_V','199016_V')

但是,这将返回+

IDList <- c('199006_V','199007_V','199008_V','199009_V','199010_V','199011_V','199013_V','199014_V','199015_V','199016_V','199017_V','199018_V','199019_V','199020_V','199021_V','199022_V','199023_V','199024_V','199025_V','199026_V','199027_V','199028_V','199029_V','199030_V','199031_V','199032_V','199033_V','199034_V','199035_V','199036_V','199037_V','199038_V','199039_V','199040_V','199041_V','199042_V','199043_V','199044_V','199045_V','199046_V','199047_V','199048_V','199050_V','199051_V','199052_V','199053_V','199054_V','199055_V','199056_V','199057_V','199059_V','199060_V','199061_V','199063_V','199064_V','199065_V','199066_V','199067_V','199068_V','199069_V','199070_V','199071_V','199072_V','199073_V','199074_V','199076_V','199077_V','199078_V','199079_V','199080_V','199081_V','199082_V','199083_V','199084_V','199085_V','199086_V','199087_V','199088_V','199089_V','199090_V','199091_V','199092_V','199093_V','199094_V','199095_V','199096_V','199097_V','199098_V','199099_V','199100_V','199101_V','199102_V','199103_V','199104_V','199105_V','199106_V','199107_V','199108_V','199109_V','199110_V','199111_V','199112_V','199113_V','199114_V','199115_V','199116_V','199117_V','199118_V','199119_V','199121_V','199124_V','199125_V','199126_V','199127_V','199129_V','199131_V','199132_V','199133_V','199134_V','199135_V','199136_V','199137_V','199138_V','199139_V','199140_V','199141_V','199142_V','199143_V','199144_V','199145_V','199146_V','199147_V','199148_V','199149_V','199150_V','199151_V','199152_V','199153_V','199154_V','199155_V','199156_V','199157_V','199158_V','199159_V','199160_V','199161_V','199162_V','199163_V','199164_V','199166_V','199167_V','199168_V','199169_V','199170_V','199171_V','199172_V','199173_V','199174_V','199175_V','199176_V','199177_V','199178_V','199179_V','199180_V','199181_V','199182_V','199183_V','199184_V','199185_V','199186_V','199187_V','199188_V','199189_V','199190_V','199191_V','199192_V','199193_V','199194_V','199195_V','199196_V','199197_V','199198_V','199199_V','199200_V','199201_V','199202_V','199203_V','199204_V','199205_V','199206_V','199207_V','199208_V','199209_V','199210_V','199211_V','199212_V','199213_V','199214_V','199215_V','199216_V','199217_V','199218_V','199219_V','199220_V','199221_V','199222_V','199223_V','199224_V','199225_V','199226_V','199227_V','199228_V','199229_V','199230_V','199231_V','199232_V','199233_V','199235_V','199236_V','199237_V','199238_V','199239_V','199240_V','199241_V','199242_V','199243_V','199244_V','199245_V','199246_V','199247_V','199248_V','199249_V','199250_V','199251_V','199252_V','199253_V','199254_V','199255_V','199256_V','199257_V','199258_V','199259_V','199260_V','199261_V','199262_V','199263_V','199264_V','199265_V','199266_V','199267_V','199268_V','199269_V','199270_V','199271_V','199272_V','199273_V','199274_V','199275_V','199276_V','199277_V','199278_V','199279_V','199280_V','199281_V','199282_V','199283_V','199284_V','199285_V','199286_V','199287_V','199288_V','199289_V','199290_V','199291_V','199292_V','199293_V','199294_V','199295_V','199296_V','199297_V','199298_V','199299_V','199301_V','199302_V','199303_V','199304_V','199305_V','199306_V','199307_V','199308_V','199309_V','199310_V','199311_V','199312_V','199313_V','199314_V','199315_V','199316_V','199317_V','199318_V','199319_V','199321_V','199322_V','199323_V','199324_V','199325_V','199326_V','199327_V','199330_V','199331_V','199332_V','199333_V','199335_V','199336_V','199337_V','199339_V','199340_V','199341_V','199342_V','199344_V','199345_V','199346_V','199347_V','199348_V','199349_V','199350_V','199351_V','199352_V','199353_V','199354_V','199355_V','199356_V','199357_V','199358_V','199359_V','199360_V','199361_V','199362_V','199363_V','199364_V','199365_V','199366_V','199367_V','199368_V','199369_V','199370_V','199371_V','199372_V','199373_V','199374_V','199375_V','199376_V','199377_V','199378_V','199379_V','199380_V','199381_V','199382_V','199383_V','199384_V','199385_V','199386_V','199387_V','199388_V','199389_V','199390_V','199391_V','199392_V','199394_V','199395_V','199396_V','199397_V','199398_V','199399_V','199400_V')

+之后的所有内容(在本例中为imageList <- makeList(IDList,'image','ERDA/wings/V',' bottom_left.jpg'))都会使c()函数失败并返回以下消息:

Error: unexpected symbol in:
"imageList <- makeList(IDList,'image"

好像c()函数没有在较长向量的末尾注册)

我在Windows 10上使用Rstudio。我的教授尝试在mac上运行相同的代码,但效果很好。我尝试使用较短的向量运行整个程序,但效果很好。我的较长向量有什么问题?

1 个答案:

答案 0 :(得分:0)

这条超长行在纯R中对我有效,但在RStudio中却不起作用。 如果分成多行,则两者都可以正常工作:

IDList <- c(
    "199006-V","199007-V","199008-V","199009-V","199010-V","199011-V","199013-V","199014-V","199015-V","199016-V",
    "199017-V","199018-V","199019-V","199020-V","199021-V","199022-V","199023-V","199024-V","199025-V","199026-V",
    "199027-V","199028-V","199029-V","199030-V","199031-V","199032-V","199033-V","199034-V","199035-V","199036-V",
    "199037-V","199038-V","199039-V","199040-V","199041-V","199042-V","199043-V","199044-V","199045-V","199046-V",
    "199047-V","199048-V","199050-V","199051-V","199052-V","199053-V","199054-V","199055-V","199056-V","199057-V",
    "199059-V","199060-V","199061-V","199063-V","199064-V","199065-V","199066-V","199067-V","199068-V","199069-V",
    "199070-V","199071-V","199072-V","199073-V","199074-V","199076-V","199077-V","199078-V","199079-V","199080-V",
    "199081-V","199082-V","199083-V","199084-V","199085-V","199086-V","199087-V","199088-V","199089-V","199090-V",
    "199091-V","199092-V","199093-V","199094-V","199095-V","199096-V","199097-V","199098-V","199099-V","199100-V",
    "199101-V","199102-V","199103-V","199104-V","199105-V","199106-V","199107-V","199108-V","199109-V","199110-V",
    "199111-V","199112-V","199113-V","199114-V","199115-V","199116-V","199117-V","199118-V","199119-V","199121-V",
    "199124-V","199125-V","199126-V","199127-V","199129-V","199131-V","199132-V","199133-V","199134-V","199135-V",
    "199136-V","199137-V","199138-V","199139-V","199140-V","199141-V","199142-V","199143-V","199144-V","199145-V",
    "199146-V","199147-V","199148-V","199149-V","199150-V","199151-V","199152-V","199153-V","199154-V","199155-V",
    "199156-V","199157-V","199158-V","199159-V","199160-V","199161-V","199162-V","199163-V","199164-V","199166-V",
    "199167-V","199168-V","199169-V","199170-V","199171-V","199172-V","199173-V","199174-V","199175-V","199176-V",
    "199177-V","199178-V","199179-V","199180-V","199181-V","199182-V","199183-V","199184-V","199185-V","199186-V",
    "199187-V","199188-V","199189-V","199190-V","199191-V","199192-V","199193-V","199194-V","199195-V","199196-V",
    "199197-V","199198-V","199199-V","199200-V","199201-V","199202-V","199203-V","199204-V","199205-V","199206-V",
    "199207-V","199208-V","199209-V","199210-V","199211-V","199212-V","199213-V","199214-V","199215-V","199216-V",
    "199217-V","199218-V","199219-V","199220-V","199221-V","199222-V","199223-V","199224-V","199225-V","199226-V",
    "199227-V","199228-V","199229-V","199230-V","199231-V","199232-V","199233-V","199235-V","199236-V","199237-V",
    "199238-V","199239-V","199240-V","199241-V","199242-V","199243-V","199244-V","199245-V","199246-V","199247-V",
    "199248-V","199249-V","199250-V","199251-V","199252-V","199253-V","199254-V","199255-V","199256-V","199257-V",
    "199258-V","199259-V","199260-V","199261-V","199262-V","199263-V","199264-V","199265-V","199266-V","199267-V",
    "199268-V","199269-V","199270-V","199271-V","199272-V","199273-V","199274-V","199275-V","199276-V","199277-V",
    "199278-V","199279-V","199280-V","199281-V","199282-V","199283-V","199284-V","199285-V","199286-V","199287-V",
    "199288-V","199289-V","199290-V","199291-V","199292-V","199293-V","199294-V","199295-V","199296-V","199297-V",
    "199298-V","199299-V","199301-V","199302-V","199303-V","199304-V","199305-V","199306-V","199307-V","199308-V",
    "199309-V","199310-V","199311-V","199312-V","199313-V","199314-V","199315-V","199316-V","199317-V","199318-V",
    "199319-V","199321-V","199322-V","199323-V","199324-V","199325-V","199326-V","199327-V","199330-V","199331-V",
    "199332-V","199333-V","199335-V","199336-V","199337-V","199339-V","199340-V","199341-V","199342-V","199344-V",
    "199345-V","199346-V","199347-V","199348-V","199349-V","199350-V","199351-V","199352-V","199353-V","199354-V",
    "199355-V","199356-V","199357-V","199358-V","199359-V","199360-V","199361-V","199362-V","199363-V","199364-V",
    "199365-V","199366-V","199367-V","199368-V","199369-V","199370-V","199371-V","199372-V","199373-V","199374-V",
    "199375-V","199376-V","199377-V","199378-V","199379-V","199380-V","199381-V","199382-V","199383-V","199384-V",
    "199385-V","199386-V","199387-V","199388-V","199389-V","199390-V","199391-V","199392-V","199394-V","199395-V",
    "199396-V","199397-V","199398-V","199399-V","199400-V")