首页 > 解决方案 > 如何按顺序命名列表的每个元素和子元素?

问题描述

我有以下列表,其中分别包含 16、14 和 13 段:

l = list(c("Let me first say that, as expected, the transition of the euro area financial markets to the year 2000 went smoothly. This positive outcome reflects the careful preparation of the banking and financial community as well as the comprehensive and flexible operational framework of the Eurosystem. ", 
"As you will be aware, the ECB took some precautionary measures to ensure against any problem in the transition to the year 2000, including the provision of sufficient liquidity in the money market during the period around the century date change. After the successful transition to the year 2000 there is no longer any need to extend the current situation of abundant liquidity. Therefore, the Eurosystem this morning conducted a liquidity-absorbing operation amounting to EUR 14.4 billion. The operation contributed to restoring more normal liquidity conditions. ", 
"The Governing Council today conducted its regular examination of the current outlook for price developments and the risks to price stability in the euro area. The interest rate on the main refinancing operations of the Eurosystem was left at 3.0% and the interest rates on the marginal lending facility and the deposit facility were maintained at 4.0% and 2.0% respectively. ", 
"Allow me to give you an overview of the main elements of our assessment of the latest information on monetary, financial market and other economic developments. ", 
"Let me start with the latest monetary developments in the euro area. The three-month average of the annual growth rates of M3, covering the period from September to November 1999, was 6.0%, that is to say slightly higher than the figure of 5.9% recorded for the three-month period from August to October 1999. Accordingly, it remained around 1½ percentage points above the reference value of 4½%. Overall, current liquidity conditions in the euro area continue to be generous. This is also confirmed by the continued strong growth of loans to the private sector (10.1% in November, compared with 9.9% in October 1999). ", 
"Moving to the euro area financial markets, as we have already noted, it is clear that they were able to weather the century date change without encountering any major problems. The associated risk premium in short-term interest rates had already declined in the last week of December 1999 and had completely disappeared by the time the markets opened on 3 January 2000. Long-term government bond yields have climbed by around 30 basis points since end-November, partly in tandem with bond yields in the United States, but also in response to a more optimistic outlook for the euro area economy. ", 
"At today's meeting the Governing Council also focused on the economic outlook. In particular, note was taken of the fact that activity in the world economy is continuing to gain momentum as projections for world output growth have been revised upwards recently. This mainly reflects the sustained and high level of growth of the US economy, but also the broad upturn in growth in other industrialised countries and the strong recovery in Asian emerging market economies. ", 
"The latest developments relating to economic activity in the euro area have contributed to the improved outlook for the global economy and are consistent with the expectation that growth differentials between the main economic regions will narrow. A recent estimate for euro area real GDP growth in the third quarter of 1999 clearly confirmed the widely expected upturn in growth. Survey data for the industrial sector point to continued solid output growth in the final quarter of last year. In addition, private consumption growth should benefit further from continued employment growth and a high level of consumer confidence. ", 
"As regards consumer price developments, the Harmonised Index of Consumer Prices (HICP) increased further in November 1999. To a large extent the upward movement in November reflects higher price increases for energy and unprocessed food, which is similar to the situation observed in previous months. The annual rate of change in the overall HICP was 1.6%, following an increase of 1.4% in October. ", 
"When discussing the risks to price stability, the Governing Council recognised that, in the short term, consumer price developments are expected to remain subject to further upward pressure. This is mainly due to higher oil prices, but also to developments in the effective exchange rate of the euro and to a gradual unwinding of the earlier downward movements in food prices. The combined effect of these factors is expected to lead to a peak in the overall HICP increase in early 2000 and to lessen thereafter. Therefore, taken by itself, the upward movement in the rate of increase in the HICP expected for early 2000 should not give undue cause for concern. However, in terms of the outlook for price stability in the medium term, it is essential that the immediate upward movement does not translate into general inflationary pressures and, in particular, that it does not trigger second round effects such as excessive wage claims. Indeed, stability-oriented behaviour is urgently required. ", 
"In conclusion, the available indicators confirm our previous analysis and assessment on the overall situation as regards the risks to price stability. Against this background, we remain both confident and vigilant. ", 
"Let me now give the floor to the Vice-President to introduce some of the additional topics. ", 
"I should like to draw your attention to two items not directly linked to today's meeting of the Governing Council. ", 
"The first one deals with one aspect of the ECB's monetary policy competence. Pursuant to the Treaty (Article 106 (2)) the ECB has the exclusive right to approve the volume of coins issued by the euro area Member States. To this end, the Governing Council adopted, in late December, a Decision on the volume of coin issuance in 2000. This Decision will be published in the Official Journal of the European Communities shortly. ", 
"The second item relates to the Executive Board's decision to adjust the ECB's organisational structure according to the needs of a still growing institution on the one hand and to better accommodate the challenges ahead on the other. Among the changes you will find an upgrading of the Directorate Statistics to a Directorate General, in order to enhance its role as provider of monetary and financial statistics to the general public, as well as a restructuring of the Directorate General Economics. An updated organisational chart is available in the room this afternoon. ", 
"We are now at your disposal, should you have any questions."
), c("the Vice-President and I are here today to report on the outcome of today's meeting of the Governing Council of the ECB. ", 
"At today's meeting the Governing Council decided to increase the ECB interest rates by 25 basis points. As a consequence, the forthcoming main refinancing operations of the Eurosystem will be conducted as fixed rate tenders at an interest rate of 3.25%, starting with the operation to be settled on 9 February 2000. In addition, the interest rate on the marginal lending facility will be increased from 4.0% to 4.25% and that on the deposit facility from 2.0% to 2.25%, both with effect from 4 February 2000. ", 
"These decisions were taken on the basis of an assessment of the risks to price stability in the medium term in the context of the Eurosystem's monetary policy strategy. Considering the first pillar of this strategy, both monetary and credit growth continue to signal generous liquidity conditions. Monetary growth has consistently been above the reference value and credit to the private sector is continuing to grow at more than 10%. These developments are indicative of upside risks to price stability in the medium term. As for the second pillar of the monetary policy strategy, price and cost increases - including oil and non-energy commodity prices as well as producer prices - have been larger and more protracted than foreseen earlier and hence indicate risks of \"second round\" effects. Such risks, which are of a more enduring nature, are further increased by the fact that the international environment is showing continuous signs of improvement and the prospects of a cyclical upswing in the euro area are very strong. Indeed, internal and external factors reinforce one another and thereby contribute to intensifying the growth of the real GDP of the euro area. The depreciation of the euro which we have witnessed is contributing to increases in import prices. ", 
"Timely and appropriate monetary policy adjustments should ensure that these risks are kept under control, so that risk premia in financial markets will be diminished. The Governing Council's determination to counter threats of inflation should assure wage negotiators that the prospects for price stability remain favourable. In fact, it will be important to ensure that wage settlements themselves do not constitute a threat to price stability in the medium term. ", 
"Allow me to give you a more detailed overview of the main elements of our assessment of the latest information on monetary, financial market and other economic developments. ", 
"Starting with the first pillar, there has been an upward movement in most recent monetary developments in the euro area. Base effects have largely contributed to the fact that the three-month average of the annual growth rate of M3 - covering the period from October to December 1999 - rose to 6.1%, after having stood at 6.0% in the three-month period ending in November 1999. At 10.5%, the annual growth rate of credit to the private sector continued to be high in December 1999. Considering the prolonged deviation of M3 growth from the reference value of 4 1/2% throughout 1999, as well as the ongoing strong expansion of credit, monetary and credit developments observed remain an important factor contributing to the upside risks to price stability. ", 
"Turning to the second pillar, long-term nominal interest rates signal increased expectations of a lasting upswing in the euro area economy. Between the end of December 1999 and the end of January 2000 ten-year government bond yields in the euro area increased further to reach the highest level observed since late 1997. ", 
"Developments in the exchange rate of the euro are becoming a cause for concern with regard to future price stability. At the end of January the nominal effective exchange rate of the euro stood approximately 11 1/2% below its level in the first quarter of 1999. Given both the magnitude and the duration of this development, import prices can be expected to rise further, thereby increasing the risk that upward pressures on consumer price inflation might materialise in the medium term. ", 
"It is all the more important to take such risks into account given that the outlook for the world economy has improved further. There are increasing signs that the upturn in world growth has become more broadly based across economic areas. In addition to the US economy continuing to enjoy robust growth, activity is also accelerating in other industrialised countries and the recovery is strong in both Asian and Latin American emerging market economies. ", 
"Euro area growth developments are in line with global trends. Following the acceleration in real GDP growth from the second to the third quarter of 1999, economic activity in the euro area can also be expected to have seen a strong expansion in the last quarter of 1999. Inter alia, the high level of industrial and consumer confidence reached in the last quarter of 1999 and the prospect of ongoing employment growth and further falling unemployment, as reflected in most recent data, all point to ongoing improvements. ", 
"With regard to consumer price developments, the rate of inflation - as measured by increases in the Harmonised Index of Consumer Prices (HICP) - has moved up further. The rise in the annual rate of change in the overall HICP from 1.5% in November to 1.7% in December 1999 was almost entirely due to an annual increase in energy prices. Our expectation is that we shall see higher inflation rates in the next few months. Inflation rates are now approaching higher levels than expected earlier, and larger and more protracted commodity and producer price increases are heightening the risk of second round effects. Against this background it is crucial for wage negotiators to be able to rely on the maintenance of price stability in the medium term. ", 
"In conclusion, it is the responsibility of the Governing Council to maintain price stability, thereby contributing to ensuring sustainable growth in the euro area. In order to maintain price stability, monetary policy needs to act in a forward-looking manner, counteracting external and domestic risks in a timely fashion. Growth in the euro area is now robust and, in order to maintain favourable conditions for a lasting economic expansion, social partners will need to keep wage increases consistent with price stability, as well as compatible with continued growth in employment. Governments will have to enhance the structural reform process in order to strengthen the economy in a durable manner. Such reforms will not only make a great contribution to the euro area remaining attractive for domestic investors, but will also contribute to increasing its attractiveness for investors located abroad. Overall, consistently acting in line with these responsibilities appears to be most conducive to maintaining price stability at the domestic level and to ensuring robust growth. This will lead to a strengthening of the euro. Indeed, a strong economy goes along with a strong currency. ", 
"We are now at your disposal, should you have any questions."
), c("The Governing Council conducted its regular examination of the outlook for price developments in the euro area. After reviewing the evidence available from both the first and the second pillar of the monetary policy strategy of the Eurosystem, the Governing Council decided to maintain the interest rate on the main refinancing operations of the Eurosystem at 3.25% and the interest rate on the marginal lending facility and that on the deposit facility at 4.25% and 2.25% respectively, i.e. at the levels determined a month ago. The Governing Council also concluded that the balance of risks to price stability in the medium term remains on the upside. These upside risks will need to be monitored and assessed continuously in order to ensure that timely action can be taken, if and when required. ", 
"The main elements of our assessment of the latest information on monetary, financial market and other economic developments are as follows. ", 
"Starting with the monetary indicators covered under the first pillar of the monetary policy strategy, the three-month average of the annual growth rates of M3 for the period from November 1999 to January 2000 was 5.7%, compared with 6.0% in the last quarter of 1999. The reduction was determined by a base effect, since the monthly increase in M3 in January 1999 was exceptionally strong, reflecting the special environment at the start of Stage Three of Economic and Monetary Union. At the same time, the annual growth rate of credit to the private sector remained high, at 9.5% in January 2000. Overall, the prolonged deviation of M3 growth from the reference value of 4½%, especially when seen in conjunction with the dynamic growth of credit, indicates that liquidity conditions in the euro area remain generous. ", 
"With regard to the second pillar, as usual, the Governing Council examined a broad range of indicators. Starting with long-term nominal interest rates, there was little change in the course of February. The yield curve remained relatively steep, thus indicating expectations of strong economic growth in the period ahead. ", 
"Such expectations are partly based on the favourable outlook for the world economy. A key element underlying this positive outlook is the fact that the US economy is continuing to grow at a high rate, but the strong recovery and the acceleration of growth in other areas also support this view. The strongest level of performance is currently being recorded in emerging market economies in South-East Asia, while the broad outlook in Japan remains uncertain. ", 
"There is also further evidence that economic activity in the euro area continued to expand strongly after the third quarter of last year. While euro area estimates for the fourth quarter of 1999 are not yet available, data for individual Member States point to continued robust output growth. In addition, area-wide industrial confidence increased further around the turn of the year and consumer confidence remained at the high level reached in the last two months of 1999. The cyclical upswing should extend well into 2000 and continue thereafter. This is also confirmed by available forecasts, which point to real GDP growth of slightly over 3% in 2000. As for 2001, the economic expansion in the euro area is generally expected to continue at a similar pace. ", 
"Developments in the exchange rate of the euro, which do not reflect the underlying strength of the euro area economy, remain a cause for concern. Their upward impact on import prices is having a negative effect on the price climate and is thereby increasing the risks to price stability in the medium term. ", 
"With regard to most recent developments in consumer price inflation, as measured by annual increases in the Harmonised Index of Consumer Prices (HICP), the upward movement has continued. In January 2000 the annual rate of HICP inflation was 2.0%, up from 1.7% in December 1999. As in earlier months, the latest upward movement is the result of the increase in energy prices, which, on an annual basis, reached 12.0% in January. Excluding the more volatile components, namely energy and seasonal food, HICP inflation in January increased slightly to 1.1% on account of somewhat higher price increases for non-energy industrial goods. ", 
"While it is likely that annual inflation rates will fall again in the course of 2000, owing to base effects related to the price of oil, monetary policy-makers need to look beyond developments over the next few months, i.e. policy will need to focus on the risks to price stability in the medium term. Indeed, whereas most forecasts still point to average inflation of below 2% in 2000 and 2001, they are based on rather favourable assumptions and generally seem to imply a pattern which is characterised first by decreasing rates of inflation in the course of this year and then by more fundamental upward tendencies later on. Against this background, the Governing Council concluded that vigilance is required and pointed to several factors. First, developments in monetary and credit aggregates will need to be analysed continuously in order to assess upward risks to price stability. Second, in view of the improving economic conditions, the potential spillover of large and protracted increases in import and producer prices into consumer prices will need to be assessed carefully. In this context, developments in the exchange rate and in oil prices will play a major role. ", 
"It will be essential, both for maintaining price stability and for reducing the high level of unemployment, that wage settlements remain moderate and do not themselves contribute to inflation expectations, which would also endanger the sustainability of the current upswing. Fiscal policies can make a substantive contribution to maintaining favourable economic conditions by using the current upswing as an excellent opportunity to proceed swiftly towards fulfilling the objectives of the Stability and Growth Pact. Economic conditions and perspectives in the euro area appear to be better at present than at any time in the past decade. Growth is strong, employment is expected to increase further and the still very high level of unemployment should continue to fall. Remaining vigilant to counter upside risks to price stability and pursuing structural reform is the foundation for a sustained period of strong economic growth and a lasting process of job creation. ", 
"Finally, I should like to draw your attention to two items not directly linked to today's meeting of the Governing Council. ", 
"First, I should like to inform you that on 30 March 2000 the Governing Council will meet for the first time outside Frankfurt, namely in Madrid. The meeting will be followed by a press conference. It is our intention that Governing Council meetings will be held in other euro area Member States twice a year. In the second half of this year it is envisaged that the Governing Council will meet in Paris. ", 
"Second, on 2 and 3 November 2000 the ECB will hold its first Central Banking Conference. The topic of the conference will be \"Why price stability?\" and it will take place in Frankfurt. The ECB's Central Banking Conference, which will be organised biennially, will bring together invited participants from central banks, international and European institutions, academia and the press. As of today, regularly updated information, including a preliminary programme, will be provided on the ECB's Web site. The final programme for the conference and all the papers, comments and a summary of the discussions will be made available on the ECB's Web site in due course. ", 
"We are now at your disposal, should you have any questions."
))

我要做的是创建一个列向量,如下所示:


[1] "Text 1.1"  "Text 1.2"  "Text 1.3"  "Text 1.4"  "Text 1.5"  "Text 1.6" 
 [7] "Text 1.7"  "Text 1.8"  "Text 1.9"  "Text 1.10" "Text 1.11" "Text 1.12"
[13] "Text 1.13" "Text 1.14" "Text 1.15" "Text 1.16" "Text 2.1"  "Text 2.2" 
[19] "Text 2.3"  "Text 2.4"  "Text 2.5"  "Text 2.6"  "Text 2.7"  "Text 2.8" 
[25] "Text 2.9"  "Text 2.10" "Text 2.11" "Text 2.12" "Text 2.13" "Text 3.1" 
[31] "Text 3.2"  "Text 3.3"  "Text 3.4"  "Text 3.5"  "Text 3.6"  "Text 3.7" 
[37] "Text 3.8"  "Text 3.9"  "Text 3.10" "Text 3.11" "Text 3.12" "Text 3.13"
[43] "Text 3.14"

基本上是一个以“文本”为基线并添加列表的每个元素的列向量,例如1.1..1.n; 2.1,..2.n, etc.

任何人都可以帮助我吗?

谢谢!

标签: rlistdataframe

解决方案


您可以使用mapply

unlist(mapply(function(x, y) sprintf('Text%d.%d', x, seq(y)), 
       seq_along(l), lengths(l)))

# [1] "Text1.1"  "Text1.2"  "Text1.3"  "Text1.4"  "Text1.5" 
# [6] "Text1.6"  "Text1.7"  "Text1.8"  "Text1.9"  "Text1.10"
#[11] "Text1.11" "Text1.12" "Text1.13" "Text1.14" "Text1.15"
#[16] "Text1.16" "Text2.1"  "Text2.2"  "Text2.3"  "Text2.4" 
#[21] "Text2.5"  "Text2.6"  "Text2.7"  "Text2.8"  "Text2.9" 
#[26] "Text2.10" "Text2.11" "Text2.12" "Text2.13" "Text3.1" 
#[31] "Text3.2"  "Text3.3"  "Text3.4"  "Text3.5"  "Text3.6" 
#[36] "Text3.7"  "Text3.8"  "Text3.9"  "Text3.10" "Text3.11"
#[41] "Text3.12" "Text3.13" "Text3.14"

还 -

inds <- lengths(l)
sprintf('Text%d.%d', rep(seq_along(l), inds), sequence(inds))

推荐阅读