debug: UseMethod(“mean”)
up vote
0
down vote
favorite
I have problem in using the mean function in R studio.
Below is my code.
# Pollutant mean
pollutantmean <- function(directory, pollutant, id = 1:332)
{
sum_nitrate = 0
sum_sulphate = 0
print(directory)
print(pollutant)
print(id)
file.names <- dir(directory, pattern=".csv")
for ( i in id)
{
infile <- paste(directory, "/", file.names[i], sep="")
print(infile)
df1 <- read.csv(infile, header = TRUE)
sum_nitrate = sum_nitrate + mean(df1$nitrate, trim=0.1, na.rm=TRUE)
}
}
I have problem in using mean please help me out.
debugging
add a comment |
up vote
0
down vote
favorite
I have problem in using the mean function in R studio.
Below is my code.
# Pollutant mean
pollutantmean <- function(directory, pollutant, id = 1:332)
{
sum_nitrate = 0
sum_sulphate = 0
print(directory)
print(pollutant)
print(id)
file.names <- dir(directory, pattern=".csv")
for ( i in id)
{
infile <- paste(directory, "/", file.names[i], sep="")
print(infile)
df1 <- read.csv(infile, header = TRUE)
sum_nitrate = sum_nitrate + mean(df1$nitrate, trim=0.1, na.rm=TRUE)
}
}
I have problem in using mean please help me out.
debugging
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have problem in using the mean function in R studio.
Below is my code.
# Pollutant mean
pollutantmean <- function(directory, pollutant, id = 1:332)
{
sum_nitrate = 0
sum_sulphate = 0
print(directory)
print(pollutant)
print(id)
file.names <- dir(directory, pattern=".csv")
for ( i in id)
{
infile <- paste(directory, "/", file.names[i], sep="")
print(infile)
df1 <- read.csv(infile, header = TRUE)
sum_nitrate = sum_nitrate + mean(df1$nitrate, trim=0.1, na.rm=TRUE)
}
}
I have problem in using mean please help me out.
debugging
I have problem in using the mean function in R studio.
Below is my code.
# Pollutant mean
pollutantmean <- function(directory, pollutant, id = 1:332)
{
sum_nitrate = 0
sum_sulphate = 0
print(directory)
print(pollutant)
print(id)
file.names <- dir(directory, pattern=".csv")
for ( i in id)
{
infile <- paste(directory, "/", file.names[i], sep="")
print(infile)
df1 <- read.csv(infile, header = TRUE)
sum_nitrate = sum_nitrate + mean(df1$nitrate, trim=0.1, na.rm=TRUE)
}
}
I have problem in using mean please help me out.
debugging
debugging
asked Nov 4 at 9:53
Raghu Parasuram Macharoutu
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
draft saved
draft discarded
draft saved
draft discarded
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
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53139548%2fdebug-usemethodmean%23new-answer', 'question_page');
}
);
Post as a guest
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
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
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