The by command is going to allow us to answer this
question. So first I'm going to create an r block of code
and I'm going to use the by command. I'll pass a www_likes
as the first parameter and then I'll pass gender as the
second, since that's the variable I would have split our
www_likes over. I want to total of likes for each gender, so
I'm going to use the sum function here. Writing this code we
can see our output. The likes for males is at 1430175.
But it's the females that have way more likes. There
are over three and a half million. It looks like
females have more than two times the number of likes
as men. And while this might seem trivial, information like this
can help websites or other businesses decide which features are
used most often by different subgroups. This might help a
business or a website decide which feature they should continue
to invest in, or which ones they should just leave behind.
سيتيح لنا الأمر by الإجابة على
هذا السؤال. لذا، أولاً سأنشئ كتلة r للتعليمة البرمجية
وسأستخدم الأمر by. سأمرر www_likes
كمعلمة أولى ثم سأمرر النوع
كمعلمة ثانية، لأنها المتغير الذي كنا قد قسمنا www_likes
عليه. أود أن أجمع الإعجابات لكل نوع، لذلك
سأستخدم دالة الجمع هنا. وبكتابة هذه التعليمة البرمجية يمكننا
.أن نرى المخرجات. الإعجابات الخاصة بالذكور هي 1430175
ولكن الإناث لديهن عدد إعجابات أكثر. يوجد
ما يزيد على ثلاثة ملايين ونصف إعجاب. ويبدو أن
الإناث لديهن إعجابات أكثر من ضعف عدد الإعجابات لدى
الرجال. وفي حين أن ذلك قد يبدو أمرًا بسيطًا، قد تساعد مثل هذه المعلومات
مواقع الويب أو الشركات التجارية الأخرى على تحديد أي السمات
تستخدمها المجموعات الفرعية المختلفة غالبًا. وقد يساعد هذا
شركة تجارية أو موقع ويب على تحديد أي ميزة يجب أن يستمروا
.في الاستثمار فيها، وأي الميزات يجب أن يتركوها
byコマンドで答えを導き出せます
まずコード{r}を書き
byコマンドを使います
www_likesを最初のパラメータとして入力し
性別でグラフを分けるため
変数genderを2つ目のパラメータとして入力します
性別ごとのいいね!の合計を出すため
sum関数を使います
コードを書くと出力結果が現れます
男性のいいね!数は1,430,175です
ですが女性の方がいいね!数は断然多く
350万以上になります
女性のいいね!数は男性の2倍以上です
ささいなことに見えますがこういった情報により
Webサイトや他のビジネス上でどの機能が
どのグループに頻繁に使われているか判断できます
どの機能に投資を続けるべきか
決定する材料になり得るのです
O comando by nos permitirá responder essa
pergunta. Primeiro, crio um bloco de código R
e uso o comando by. Passo um www_likes
como primeiro parâmetro e, depois, o sexo como
segundo, já que essa é a variável sobre a qual teria separado nosso
www_likes. Eu quero o total de curtidas para cada sexo, então
vou usar a função de soma aqui. Escrevendo esse código,
podemos ver nossa saída. As curtidas para os homens são 1.430.175.
Mas são as mulheres que têm muito mais curtidas. Há
mais de 3,5 milhões. Parece que
as mulheres têm duas vezes mais a quantidade de curtidas
que os homens. Embora isso possa parecer banal, informações como essa
ajudam sites e outros negócios a decidirem quais recursos são
usados com mais frequência por diferentes subgrupos. Isso pode ajudar uma
empresa ou um site a decidir em quais recursos devem continuar
a investir ou quais eles devem simplesmente abandonar.
by 命令可让我们解答这个问题
首先 我将创建一个 r 代码块
将会用到 by 命令 我将传递 www_likes
作为第一个参数 然后传递性别作为第二个
因为这是用来分割 www_likes 所用的变量
我需要每个性别的点赞总数
所以在这里使用 sum 函数 编写此代码
我们可以看到输出 男性的点赞数为 1430175
但是女性有更多的点赞数
超过 350 万
看起来女性的点赞数要比男性高出两倍多
虽然这个看起来可能不太重要 但此类信息
可帮助网站或其它公司来确定
哪些功能被不同的亚组最常使用
这可以帮助公司或网站确定应该继续投入哪种功能
或者把哪些功能丢弃