R: Function to repeat counting words in strings with different arguments
up vote
0
down vote
favorite
I am counting the sum of words of strings with specific arguments e.g. for weeks (week 1 = 1, week 2 = 2 and so on) with the following command:
sum(data[which(data[,17]==1), 19])
[,17] is the column in the data frame of the numeric argument of the week which has to be 1 for week 1
, 19 is the column in the data frame of the number of words of each string
I have 31 weeks and 228.000 strings and I do not want to execute each command for each week seperately so I am searching for a function which can do it automatically for week 1-31 and gives me the results.
Thanks for helping!
r string function count repeat
add a comment |
up vote
0
down vote
favorite
I am counting the sum of words of strings with specific arguments e.g. for weeks (week 1 = 1, week 2 = 2 and so on) with the following command:
sum(data[which(data[,17]==1), 19])
[,17] is the column in the data frame of the numeric argument of the week which has to be 1 for week 1
, 19 is the column in the data frame of the number of words of each string
I have 31 weeks and 228.000 strings and I do not want to execute each command for each week seperately so I am searching for a function which can do it automatically for week 1-31 and gives me the results.
Thanks for helping!
r string function count repeat
can you make a reproducible example with withdput(head(data, 15))or similar?
– snoram
Nov 13 at 9:23
Sorry but I do not know how these function can help me
– MisterD
Nov 13 at 9:38
Sharing data in your original post makes it much easier for other members to help you. See more info here: stackoverflow.com/questions/5963269/…
– snoram
Nov 13 at 9:48
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am counting the sum of words of strings with specific arguments e.g. for weeks (week 1 = 1, week 2 = 2 and so on) with the following command:
sum(data[which(data[,17]==1), 19])
[,17] is the column in the data frame of the numeric argument of the week which has to be 1 for week 1
, 19 is the column in the data frame of the number of words of each string
I have 31 weeks and 228.000 strings and I do not want to execute each command for each week seperately so I am searching for a function which can do it automatically for week 1-31 and gives me the results.
Thanks for helping!
r string function count repeat
I am counting the sum of words of strings with specific arguments e.g. for weeks (week 1 = 1, week 2 = 2 and so on) with the following command:
sum(data[which(data[,17]==1), 19])
[,17] is the column in the data frame of the numeric argument of the week which has to be 1 for week 1
, 19 is the column in the data frame of the number of words of each string
I have 31 weeks and 228.000 strings and I do not want to execute each command for each week seperately so I am searching for a function which can do it automatically for week 1-31 and gives me the results.
Thanks for helping!
r string function count repeat
r string function count repeat
edited Nov 13 at 9:22
snoram
5,794730
5,794730
asked Nov 13 at 9:20
MisterD
1
1
can you make a reproducible example with withdput(head(data, 15))or similar?
– snoram
Nov 13 at 9:23
Sorry but I do not know how these function can help me
– MisterD
Nov 13 at 9:38
Sharing data in your original post makes it much easier for other members to help you. See more info here: stackoverflow.com/questions/5963269/…
– snoram
Nov 13 at 9:48
add a comment |
can you make a reproducible example with withdput(head(data, 15))or similar?
– snoram
Nov 13 at 9:23
Sorry but I do not know how these function can help me
– MisterD
Nov 13 at 9:38
Sharing data in your original post makes it much easier for other members to help you. See more info here: stackoverflow.com/questions/5963269/…
– snoram
Nov 13 at 9:48
can you make a reproducible example with with
dput(head(data, 15)) or similar?– snoram
Nov 13 at 9:23
can you make a reproducible example with with
dput(head(data, 15)) or similar?– snoram
Nov 13 at 9:23
Sorry but I do not know how these function can help me
– MisterD
Nov 13 at 9:38
Sorry but I do not know how these function can help me
– MisterD
Nov 13 at 9:38
Sharing data in your original post makes it much easier for other members to help you. See more info here: stackoverflow.com/questions/5963269/…
– snoram
Nov 13 at 9:48
Sharing data in your original post makes it much easier for other members to help you. See more info here: stackoverflow.com/questions/5963269/…
– snoram
Nov 13 at 9:48
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53277607%2fr-function-to-repeat-counting-words-in-strings-with-different-arguments%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
can you make a reproducible example with with
dput(head(data, 15))or similar?– snoram
Nov 13 at 9:23
Sorry but I do not know how these function can help me
– MisterD
Nov 13 at 9:38
Sharing data in your original post makes it much easier for other members to help you. See more info here: stackoverflow.com/questions/5963269/…
– snoram
Nov 13 at 9:48