R:载体的粘贴元素

时间:2015-05-09 08:36:42

标签: r vector

我在R中遇到以下情况:

filiaalnummer filiaal filiaal filiaal filiaal type type type omschrijving omschrijving filiaalnaam

每次数字代表上述单词的频率。我想将矢量名称粘贴到一个具有正确频率的元素中,所以我想得到以下内容:

 <asp:Panel ID="Panel2" runat="server"  CssClass="mid">
    <asp:GridView ID="BuyerGrid" runat="server" AutoGenerateColumns="False" DataKeyNames="BuyerId" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowCommand="BuyerGrid_RowCommand">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="BuyerName" HeaderText="Buyer Name" />
            <asp:BoundField DataField="BuyerCode" HeaderText="Buyer Code" />
            <asp:BoundField DataField="CountryName" HeaderText="Country" />
            <asp:BoundField DataField="CityName" HeaderText="City" />
             <asp:TemplateField HeaderText="" SortExpression="">
                <ItemTemplate>


<asp:LinkButton ID="LinkButtonEdit" runat="server" CommandName="Edit"
CommandArgument='<%#Eval("BuyerId") %>'>Edit</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
            </asp:Panel>

1 个答案:

答案 0 :(得分:5)

试试这个:

rep(names(wordfreq), times = wordfreq)

这是一个可重复的例子:

wordfreq = sample.int(10, 5, replace = TRUE)
names(wordfreq) = letters[1:5]
rep(names(wordfreq), times = wordfreq)