Why glm make an input error on this function












0















I'm trying to run a glm in R but it results me with an error I can't figure it out how to solve:



> GLM.3 <- glm(log(Total_Pass + 1) ~ Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud + hielo + alt_media + pend_media + Temp_media + PP_media + CA _100 + PLAND _100 + PD _100 + ED _100 + AREA_MN _100 + ENN_MN_100 + CA _210 + PLAND _210 + PD _210 + ED _210 + AREA_MN _210 + ENN_MN_210 + CA _600 + PLAND _600 + PD _600 + ED _600 + AREA_MN _600 + ENN_MN_600 + SHDI + SIDI + MSIDI + SHEI + SIEI + MSIEI, family=gaussian(identity), data=bats_araucania_500)
Error: unexpected input in "Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud"


Any help is useful










share|improve this question




















  • 1





    Welcome to StackOverflow. See how to make a great reproducible example.

    – Anonymous coward
    Nov 21 '18 at 16:20






  • 3





    Do you have spaces in your column names" When you have + CA _100 + that's not valid because of the space between the CA and _. R can't parse such a value. You'd have to surround those values in backticks. What exactly does names(bats_araucania_500) return?

    – MrFlick
    Nov 21 '18 at 16:23













  • as general points: that looks like a lot of covariates to be regressing against. you'll probably want to remove quite a few of them. also regressing log(Y+1) against Y looks very unusual, are you sure you want to be doing that?!

    – Sam Mason
    Nov 21 '18 at 22:19
















0















I'm trying to run a glm in R but it results me with an error I can't figure it out how to solve:



> GLM.3 <- glm(log(Total_Pass + 1) ~ Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud + hielo + alt_media + pend_media + Temp_media + PP_media + CA _100 + PLAND _100 + PD _100 + ED _100 + AREA_MN _100 + ENN_MN_100 + CA _210 + PLAND _210 + PD _210 + ED _210 + AREA_MN _210 + ENN_MN_210 + CA _600 + PLAND _600 + PD _600 + ED _600 + AREA_MN _600 + ENN_MN_600 + SHDI + SIDI + MSIDI + SHEI + SIEI + MSIEI, family=gaussian(identity), data=bats_araucania_500)
Error: unexpected input in "Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud"


Any help is useful










share|improve this question




















  • 1





    Welcome to StackOverflow. See how to make a great reproducible example.

    – Anonymous coward
    Nov 21 '18 at 16:20






  • 3





    Do you have spaces in your column names" When you have + CA _100 + that's not valid because of the space between the CA and _. R can't parse such a value. You'd have to surround those values in backticks. What exactly does names(bats_araucania_500) return?

    – MrFlick
    Nov 21 '18 at 16:23













  • as general points: that looks like a lot of covariates to be regressing against. you'll probably want to remove quite a few of them. also regressing log(Y+1) against Y looks very unusual, are you sure you want to be doing that?!

    – Sam Mason
    Nov 21 '18 at 22:19














0












0








0








I'm trying to run a glm in R but it results me with an error I can't figure it out how to solve:



> GLM.3 <- glm(log(Total_Pass + 1) ~ Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud + hielo + alt_media + pend_media + Temp_media + PP_media + CA _100 + PLAND _100 + PD _100 + ED _100 + AREA_MN _100 + ENN_MN_100 + CA _210 + PLAND _210 + PD _210 + ED _210 + AREA_MN _210 + ENN_MN_210 + CA _600 + PLAND _600 + PD _600 + ED _600 + AREA_MN _600 + ENN_MN_600 + SHDI + SIDI + MSIDI + SHEI + SIEI + MSIEI, family=gaussian(identity), data=bats_araucania_500)
Error: unexpected input in "Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud"


Any help is useful










share|improve this question
















I'm trying to run a glm in R but it results me with an error I can't figure it out how to solve:



> GLM.3 <- glm(log(Total_Pass + 1) ~ Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud + hielo + alt_media + pend_media + Temp_media + PP_media + CA _100 + PLAND _100 + PD _100 + ED _100 + AREA_MN _100 + ENN_MN_100 + CA _210 + PLAND _210 + PD _210 + ED _210 + AREA_MN _210 + ENN_MN_210 + CA _600 + PLAND _600 + PD _600 + ED _600 + AREA_MN _600 + ENN_MN_600 + SHDI + SIDI + MSIDI + SHEI + SIEI + MSIEI, family=gaussian(identity), data=bats_araucania_500)
Error: unexpected input in "Total_Pass + Total_Buzz + dm_plant + dm_cdeagua + dm_cultivo + dm_humed + dm_bnativ + dm_snaspe + Cultivos + BosqNat + Plantac + Pastizal + Matorral + Humedal + C_agua + Sup_imper + Tie_desnud"


Any help is useful







r glm






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 '18 at 23:48









K.Dᴀᴠɪs

7,320112440




7,320112440










asked Nov 21 '18 at 16:12









Gastón Sepúlveda TruanGastón Sepúlveda Truan

52




52








  • 1





    Welcome to StackOverflow. See how to make a great reproducible example.

    – Anonymous coward
    Nov 21 '18 at 16:20






  • 3





    Do you have spaces in your column names" When you have + CA _100 + that's not valid because of the space between the CA and _. R can't parse such a value. You'd have to surround those values in backticks. What exactly does names(bats_araucania_500) return?

    – MrFlick
    Nov 21 '18 at 16:23













  • as general points: that looks like a lot of covariates to be regressing against. you'll probably want to remove quite a few of them. also regressing log(Y+1) against Y looks very unusual, are you sure you want to be doing that?!

    – Sam Mason
    Nov 21 '18 at 22:19














  • 1





    Welcome to StackOverflow. See how to make a great reproducible example.

    – Anonymous coward
    Nov 21 '18 at 16:20






  • 3





    Do you have spaces in your column names" When you have + CA _100 + that's not valid because of the space between the CA and _. R can't parse such a value. You'd have to surround those values in backticks. What exactly does names(bats_araucania_500) return?

    – MrFlick
    Nov 21 '18 at 16:23













  • as general points: that looks like a lot of covariates to be regressing against. you'll probably want to remove quite a few of them. also regressing log(Y+1) against Y looks very unusual, are you sure you want to be doing that?!

    – Sam Mason
    Nov 21 '18 at 22:19








1




1





Welcome to StackOverflow. See how to make a great reproducible example.

– Anonymous coward
Nov 21 '18 at 16:20





Welcome to StackOverflow. See how to make a great reproducible example.

– Anonymous coward
Nov 21 '18 at 16:20




3




3





Do you have spaces in your column names" When you have + CA _100 + that's not valid because of the space between the CA and _. R can't parse such a value. You'd have to surround those values in backticks. What exactly does names(bats_araucania_500) return?

– MrFlick
Nov 21 '18 at 16:23







Do you have spaces in your column names" When you have + CA _100 + that's not valid because of the space between the CA and _. R can't parse such a value. You'd have to surround those values in backticks. What exactly does names(bats_araucania_500) return?

– MrFlick
Nov 21 '18 at 16:23















as general points: that looks like a lot of covariates to be regressing against. you'll probably want to remove quite a few of them. also regressing log(Y+1) against Y looks very unusual, are you sure you want to be doing that?!

– Sam Mason
Nov 21 '18 at 22:19





as general points: that looks like a lot of covariates to be regressing against. you'll probably want to remove quite a few of them. also regressing log(Y+1) against Y looks very unusual, are you sure you want to be doing that?!

– Sam Mason
Nov 21 '18 at 22:19












1 Answer
1






active

oldest

votes


















0














R can not handle column names with space: CA _210. Try to wrap these columns between two ` (backticks) or rename your columns without spaces.



FYI : If you are using all columns as predictors, you can write your code this way: glm(log(y+1) ~ . , nextargs...)






share|improve this answer
























  • Yes, it was the space between characters, i redid all and run it

    – Gastón Sepúlveda Truan
    Nov 21 '18 at 17:07











  • Good, you can now close the question with accepting answer

    – emsinko
    Nov 21 '18 at 17:45













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416208%2fwhy-glm-make-an-input-error-on-this-function%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














R can not handle column names with space: CA _210. Try to wrap these columns between two ` (backticks) or rename your columns without spaces.



FYI : If you are using all columns as predictors, you can write your code this way: glm(log(y+1) ~ . , nextargs...)






share|improve this answer
























  • Yes, it was the space between characters, i redid all and run it

    – Gastón Sepúlveda Truan
    Nov 21 '18 at 17:07











  • Good, you can now close the question with accepting answer

    – emsinko
    Nov 21 '18 at 17:45


















0














R can not handle column names with space: CA _210. Try to wrap these columns between two ` (backticks) or rename your columns without spaces.



FYI : If you are using all columns as predictors, you can write your code this way: glm(log(y+1) ~ . , nextargs...)






share|improve this answer
























  • Yes, it was the space between characters, i redid all and run it

    – Gastón Sepúlveda Truan
    Nov 21 '18 at 17:07











  • Good, you can now close the question with accepting answer

    – emsinko
    Nov 21 '18 at 17:45
















0












0








0







R can not handle column names with space: CA _210. Try to wrap these columns between two ` (backticks) or rename your columns without spaces.



FYI : If you are using all columns as predictors, you can write your code this way: glm(log(y+1) ~ . , nextargs...)






share|improve this answer













R can not handle column names with space: CA _210. Try to wrap these columns between two ` (backticks) or rename your columns without spaces.



FYI : If you are using all columns as predictors, you can write your code this way: glm(log(y+1) ~ . , nextargs...)







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 21 '18 at 16:36









emsinkoemsinko

18616




18616













  • Yes, it was the space between characters, i redid all and run it

    – Gastón Sepúlveda Truan
    Nov 21 '18 at 17:07











  • Good, you can now close the question with accepting answer

    – emsinko
    Nov 21 '18 at 17:45





















  • Yes, it was the space between characters, i redid all and run it

    – Gastón Sepúlveda Truan
    Nov 21 '18 at 17:07











  • Good, you can now close the question with accepting answer

    – emsinko
    Nov 21 '18 at 17:45



















Yes, it was the space between characters, i redid all and run it

– Gastón Sepúlveda Truan
Nov 21 '18 at 17:07





Yes, it was the space between characters, i redid all and run it

– Gastón Sepúlveda Truan
Nov 21 '18 at 17:07













Good, you can now close the question with accepting answer

– emsinko
Nov 21 '18 at 17:45







Good, you can now close the question with accepting answer

– emsinko
Nov 21 '18 at 17:45






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416208%2fwhy-glm-make-an-input-error-on-this-function%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?