Выбор переменной с использованием regsubset в R - PullRequest
0 голосов
/ 15 апреля 2019

Я работаю над проектом Tweets и извлек 87 переменных, теперь мне нужно выполнить метод выбора переменных, поэтому я использовал прямой выбор поднабора.Но я столкнулся с ошибкой.

 regfit.fwd = regsubsets(screen_name ~.,merge_tweets,method = "forward",
                    complete.cases(merge_tweets),nvmax = 15)

  Error in leaps.setup(x[, ii[reorder], drop = FALSE], y, wt, 
  force.in[reorder],  : NA/NaN/Inf in foreign function call (arg 4)

  > head(merge_tweets)
  X    user_id    status_id created_at    screen_name
  1 1 1339835893 1.090257e+18 1548772454 HillaryClinton
  2 2 1339835893 1.090002e+18 1548711688 HillaryClinton
  3 3 1339835893 1.089999e+18 1548710912 HillaryClinton
  4 4 1339835893 1.089994e+18 1548709837 HillaryClinton
  5 5 1339835893 1.089994e+18 1548709756 HillaryClinton
  6 6 1339835893 1.089994e+18 1548709738 HillaryClinton

 text
 1                                                                       On 
top of human suffering and lasting damage to our national parks, the Trump 
shutdown cost the economy $11 billion. End shutdowns as a political hostage- 
taking tactic. 
2    Hurricane Maria decimated trees and ecosystems in Puerto Rico. Para La 
Naturaleza's nurseries have made a CGI commitment to plant 750,000 trees in 
seven years. The team here has already grown 120,000 seedlings and planted 
30,000 trees.               source display_text_width is_quote is_retweet favorite_count 
retweet_count lang
1 Twitter Web Client                192    FALSE      FALSE          14324          
4168   en
2 Twitter Web Client                235    FALSE      FALSE          10684          
2526   en
3 Twitter Web Client                238    FALSE      FALSE          11423          
2089   en
4 Twitter Web Client                 34    FALSE      FALSE           1293           
113   en
5 Twitter Web Client                222    FALSE      FALSE           6641           
951   en
6 Twitter Web Client                214    FALSE      FALSE          12192          
2108   en
                                                 status_url            name     
location
 Hillary 
Clinton New York, NY
 Hillary 
Clinton New York, NY

description
1 2016 Democratic Nominee, SecState, Senator, hair icon. Mom, Wife, Grandma 
x2, lawyer, advocate, fan of walks in the woods & standing up for our 
democracy.
2 2016 Democratic Nominee, SecState, Senator, hair icon. Mom, Wife, Grandma 
x2, lawyer, advocate, fan of walks in the woods & standing up for our 
democracy.
                  url protected followers_count friends_count listed_count 
statuses_count
1    FALSE        24017203           784        
41782          10667
2      FALSE        24017203           784        
41782          10667
3      FALSE        24017203           784        
41782          10667
favourites_count account_created_at verified             profile_url      
profile_expanded_url
1             1138         1365530675     TRUE 
2             1138         1365530675     TRUE 
3             1138         1365530675     TRUE 

Я удалил некоторые столбцы URL, поскольку они не поддерживают размещение URL.Было бы здорово, если бы кто-нибудь помог мне в решении этой проблемы.Заранее спасибо !!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...