Ubuntu 22.04 下的 R 控制台问题

Ubuntu 22.04 下的 R 控制台问题

我最近升级到了 Ubuntu 22.04。升级后,R 控制台似乎无法正常工作。问题是,当我将几行代码粘贴到 R 控制台时,只有几行代码被附加(似乎是对要粘贴的行数的限制)。例如,尝试将以下内容粘贴到 R 控制台中,只有几个条目(最多 158 行被正确附加)。我用其他 R 版本(4.1.2;4-2.0;4-2.1)测试了这一点,所有版本都存在此问题。Ubuntu 20 下不存在此问题。任何帮助都将不胜感激。

   rm(list=ls())

   codes.vector = character(1)

   codes.vector[1] = "ADS.DE"
   codes.vector[2] = "AIR.PA"
   codes.vector[3] = "ALV.DE"
   codes.vector[4] = "BAS.DE"
   codes.vector[5] = "BAYN.DE"
   codes.vector[6] = "BMW.DE"
   codes.vector[7] = "BEI.DE"
   codes.vector[8] = "BNR.DE"
   codes.vector[9] = "CON.DE"
   codes.vector[10]= "1COV.DE"
   codes.vector[11]= "DTG.DE"
   codes.vector[12]= "DBK.DE"
   codes.vector[13]= "DPW.DE"
   codes.vector[14]= "DTE.DE"
   codes.vector[15]= "EOAN.DE"
   codes.vector[16]= "FMEA.SG"
   codes.vector[17]= "FRE.DE"
   codes.vector[18]= "HEI.DE"
   codes.vector[19]= "HFG.DE"
   codes.vector[20]= "HEN3.DE"
   codes.vector[21]= "IFX.DE"
   codes.vector[22]= "LIN.DE"
   codes.vector[23]= "MBG.DE"
   codes.vector[24]= "MRK.DE"
  codes.vector[25]= "MTX.DE"
  codes.vector[26]= "PAH3.DE"
   codes.vector[27]= "PUM.DE"
   codes.vector[28]= "QIA.DE"
   codes.vector[29]= "RWE.DE"
   codes.vector[30]= "SAP.DE"
   codes.vector[31]= "SRT3.DE"
   codes.vector[32]= "SIE.DE"
   codes.vector[33]= "SHL.DE"
   codes.vector[34]= "SY1.DE"
   codes.vector[35]= "VOW.VI"
   codes.vector[36]= "VNA.DE"
   codes.vector[37]= "ZAL.DE"
   codes.vector[38] = "MMM"
   codes.vector[39] = "ATVI"
   codes.vector[40] = "ADBE"
   codes.vector[41] = "AMD"
   codes.vector[42] = "ABNB"
   codes.vector[43] = "ALGN"
   codes.vector[44] = "GOOGL"
   codes.vector[45] = "GOOG"
   codes.vector[46] = "AMZN"
   codes.vector[47] = "AEP"
   codes.vector[48] = "AXP"
   codes.vector[49] = "AMGN"
   codes.vector[50] = "ADI"
   codes.vector[51] = "ANSS"
   codes.vector[52] = "AAPL"
   codes.vector[53] = "AMAT"
   codes.vector[54] = "ASML"
   codes.vector[55] = "AZN"
   codes.vector[56] = "TEAM"
   codes.vector[57] = "ADSK"
   codes.vector[58] = "ADP"
   codes.vector[59] = "B1C.SG"
   codes.vector[60] = "BIIB"
   codes.vector[61] = "BA"
   codes.vector[62] = "BKNG"
   codes.vector[63] = "AVGO"
   codes.vector[64] = "CDNS"
   codes.vector[65] = "CAT"
   codes.vector[66] = "CHTR"
   codes.vector[67] = "CVX"
   codes.vector[68] = "CTAS"
   codes.vector[69] = "CSCO"
   codes.vector[70] = "KO"
   codes.vector[71] = "CTSH"
   codes.vector[72] = "CMCSA"
   codes.vector[73] = "CEG"
   codes.vector[74] = "CPRT"
   codes.vector[75] = "COST"
   codes.vector[76] = "CRWD"
   codes.vector[77] = "CSX"
   codes.vector[78] = "DDOG"
   codes.vector[79] = "DXCM"
   codes.vector[80] = "DOCU"
   codes.vector[81] = "DLTR"
   codes.vector[82] = "DOW"
   codes.vector[83] = "EBAY"
   codes.vector[84] = "EA"
   codes.vector[85] = "FAST"
   codes.vector[86] = "FISV"
   codes.vector[87] = "FTNT"
   codes.vector[88] = "FOX"
   codes.vector[89] = "GILD"
   codes.vector[90] = "GS"
   codes.vector[91] = "HD"
   codes.vector[92] = "HON"
   codes.vector[93] = "IDXX"
   codes.vector[94] = "ILMN"
   codes.vector[95] = "INTC"
   codes.vector[96] = "IBM.VI"
   codes.vector[97] = "INTU"
   codes.vector[98] = "ISRG"
   codes.vector[99] = "JD"
   codes.vector[100] = "JNJ"
   codes.vector[101] = "JPM"
   codes.vector[102] = "KDP"
   codes.vector[103] = "KLAC"
   codes.vector[104] = "KHC"
   codes.vector[105] = "LRCX"
   codes.vector[106] = "LCID"
   codes.vector[107] = "LULU"
   codes.vector[108] = "MAR"
   codes.vector[109] = "MRVL"
   codes.vector[110] = "MTCH"
   codes.vector[111] = "MCD"
   codes.vector[112] = "MELI"
   codes.vector[113] = "MRK"
   codes.vector[114] = "META"
   codes.vector[115] = "MCHP"
   codes.vector[116] = "MU"
   codes.vector[117] = "MSFT"
    codes.vector[118] = "MRNA"
   codes.vector[119] = "MDLZ"
   codes.vector[120] = "MNST"
   codes.vector[121] = "NTES"
   codes.vector[122] = "NFLX"
   codes.vector[123] = "NKE"
   codes.vector[124] = "NVDA"
   codes.vector[125] = "NXPI"
   codes.vector[126] = "ORLY"
   codes.vector[127] = "OKTA"
   codes.vector[128] = "ODFL"
   codes.vector[129] = "PCAR"
   codes.vector[130] = "PANW"
   codes.vector[131] = "PAYX"
   codes.vector[132] = "PYPL"
   codes.vector[133] = "PEP"
   codes.vector[134] = "PDD"
   codes.vector[135] = "PG"
   codes.vector[136] = "QCOM"
   codes.vector[137] = "REGN"
   codes.vector[138] = "ROST"
   codes.vector[139] = "CRM"
   codes.vector[140] = "SGEN"
   codes.vector[141] = "SIRI"
   codes.vector[142] = "SWKS"
   codes.vector[143] = "SPLK"
   codes.vector[144] = "SBUX"
   codes.vector[145] = "SNPS"
   codes.vector[146] = "TMUS"
   codes.vector[147] = "TSLA"
   codes.vector[148] = "TXN"
   codes.vector[149] = "TRV"
   codes.vector[150] = "UNH"
   codes.vector[151] = "VRSN"
   codes.vector[152] = "VRSK"
   codes.vector[153] = "VZ"
   codes.vector[154] = "VRTX"
   codes.vector[155] = "VTRS"
   codes.vector[156] = "V"
   codes.vector[157] = "WBA"
   codes.vector[158] = "WMT"
   codes.vector[159] = "DIS"
   codes.vector[160] = "WDAY"
   codes.vector[161] = "XEL"
   codes.vector[162] = "ZM"
   codes.vector[163] = "ZS

答案1

这可能是您使用的终端仿真器的一个限制。不过,最好不要复制粘贴大段代码。相反,请使用source(),并将复制/粘贴留给您可以监督的较小、可管理的文本片段。

或者,您也可以关闭“括号粘贴”恢复到终端的传统行为,其中粘贴的行将逐行执行。

相关内容