Cannot install package "boot" and error package “vsurf” in rstudio cloud.

heart_failure_clinical <-read.csv(file.choose(),header = TRUE)
heart_failure_clinical

> heart_failure_clinical <-read.csv(file.choose(),header = TRUE)
> heart_failure_clinical
   age anaemia creatinine_phosphokinase diabetes ejection_fraction
1   75       0                      582        0                20
2   55       0                     7861        0                38
3   65       0                      146        0                20
4   50       1                      111        0                20
5   65       1                      160        1                20
6   90       1                       47        0                40
7   75       1                      246        0                15
8   60       1                      315        1                60
9   65       0                      157        0                65
10  80       1                      123        0                35
11  75       1                       81        0                38
12  62       0                      231        0                25
13  45       1                      981        0                30
14  50       1                      168        0                38
15  49       1                       80        0                30
16  82       1                      379        0                50
17  87       1                      149        0                38
18  45       0                      582        0                14
19  70       1                      125        0                25
20  48       1                      582        1                55
21  65       1                       52        0                25
22  65       1                      128        1                30
23  68       1                      220        0                35
24  53       0                       63        1                60
25  75       0                      582        1                30
26  80       0                      148        1                38
27  95       1                      112        0                40
28  70       0                      122        1                45
29  58       1                       60        0                38
30  82       0                       70        1                30
31  94       0                      582        1                38
32  85       0                       23        0                45
33  50       1                      249        1                35
34  50       1                      159        1                30
35  65       0                       94        1                50
36  69       0                      582        1                35
37  90       1                       60        1                50
38  82       1                      855        1                50
39  60       0                     2656        1                30
40  60       0                      235        1                38
41  70       0                      582        0                20
42  50       0                      124        1                30
43  70       0                      571        1                45
44  72       0                      127        1                50
45  60       1                      588        1                60
46  50       0                      582        1                38
47  51       0                     1380        0                25
48  60       0                      582        1                38
49  80       1                      553        0                20
50  57       1                      129        0                30
51  68       1                      577        0                25
52  53       1                       91        0                20
53  60       0                     3964        1                62
54  70       1                       69        1                50
55  60       1                      260        1                38
56  95       1                      371        0                30
57  70       1                       75        0                35
58  60       1                      607        0                40
59  49       0                      789        0                20
60  72       0                      364        1                20
61  45       0                     7702        1                25
62  50       0                      318        0                40
63  55       0                      109        0                35
64  45       0                      582        0                35
65  45       0                      582        0                80
66  60       0                       68        0                20
67  42       1                      250        1                15
68  72       1                      110        0                25
69  70       0                      161        0                25
70  65       0                      113        1                25
71  41       0                      148        0                40
72  58       0                      582        1                35
73  85       0                     5882        0                35
74  65       0                      224        1                50
75  69       0                      582        0                20
76  60       1                       47        0                20
   high_blood_pressure platelets serum_creatinine serum_sodium gender smoking time
1                    1    265000             1.90          130      1       0    4
2                    0    263358             1.10          136      1       0    6
3                    0    162000             1.30          129      1       1    7
4                    0    210000             1.90          137      1       0    7
5                    0    327000             2.70          116      0       0    8
6                    1    204000             2.10          132      1       1    8
7                    0    127000             1.20          137      1       0   10
8                    0    454000             1.10          131      1       1   10
9                    0    263358             1.50          138      0       0   10
10                   1    388000             9.40          133      1       1   10
11                   1    368000             4.00          131      1       1   10
12                   1    253000             0.90          140      1       1   10
13                   0    136000             1.10          137      1       0   11
14                   1    276000             1.10          137      1       0   11
15                   1    427000             1.00          138      0       0   12
16                   0     47000             1.30          136      1       0   13
17                   0    262000             0.90          140      1       0   14
18                   0    166000             0.80          127      1       0   14
19                   1    237000             1.00          140      0       0   15
20                   0     87000             1.90          121      0       0   15
21                   1    276000             1.30          137      0       0   16
22                   1    297000             1.60          136      0       0   20
23                   1    289000             0.90          140      1       1   20
24                   0    368000             0.80          135      1       0   22
25                   1    263358             1.83          134      0       0   23
26                   0    149000             1.90          144      1       1   23
27                   1    196000             1.00          138      0       0   24
28                   1    284000             1.30          136      1       1   26
29                   0    153000             5.80          134      1       0   26
30                   0    200000             1.20          132      1       1   26
31                   1    263358             1.83          134      1       0   27
32                   0    360000             3.00          132      1       0   28
33                   1    319000             1.00          128      0       0   28
34                   0    302000             1.20          138      0       0   29
35                   1    188000             1.00          140      1       0   29
36                   0    228000             3.50          134      1       0   30
37                   0    226000             1.00          134      1       0   30
38                   1    321000             1.00          145      0       0   30
39                   0    305000             2.30          137      1       0   30
40                   0    329000             3.00          142      0       0   30
41                   1    263358             1.83          134      1       1   31
42                   1    153000             1.20          136      0       1   32
43                   1    185000             1.20          139      1       1   33
44                   1    218000             1.00          134      1       0   33
45                   0    194000             1.10          142      0       0   33
46                   0    310000             1.90          135      1       1   35
47                   1    271000             0.90          130      1       0   38
48                   1    451000             0.60          138      1       1   40
49                   1    140000             4.40          133      1       0   41
50                   0    395000             1.00          140      0       0   42
51                   1    166000             1.00          138      1       0   43
52                   1    418000             1.40          139      0       0   43
53                   0    263358             6.80          146      0       0   43
54                   1    351000             1.00          134      0       0   44
55                   0    255000             2.20          132      0       1   45
56                   0    461000             2.00          132      1       0   50
57                   0    223000             2.70          138      1       1   54
58                   0    216000             0.60          138      1       1   54
59                   1    319000             1.10          136      1       1   55
60                   1    254000             1.30          136      1       1   59
61                   1    390000             1.00          139      1       0   60
62                   1    216000             2.30          131      0       0   60
63                   0    254000             1.10          139      1       1   60
64                   0    385000             1.00          145      1       0   61
65                   0    263358             1.18          137      0       0   63
66                   0    119000             2.90          127      1       1   64
67                   0    213000             1.30          136      0       0   65
68                   0    274000             1.00          140      1       1   65
69                   0    244000             1.20          142      0       0   66
70                   0    497000             1.83          135      1       0   67
71                   0    374000             0.80          140      1       1   68
72                   0    122000             0.90          139      1       1   71
73                   0    243000             1.00          132      1       1   72
74                   0    149000             1.30          137      1       1   72
75                   0    266000             1.20          134      1       1   73
76                   0    204000             0.70          139      1       1   73
   DEATH_EVENT
1            1
2            1
3            1
4            1
5            1
6            1
7            1
8            1
9            1
10           1
11           1
12           1
13           1
14           1
15           0
16           1
17           1
18           1
19           1
20           1
21           0
22           1
23           1
24           0
25           1
26           1
27           1
28           1
29           1
30           1
31           1
32           1
33           1
34           0
35           1
36           1
37           1
38           1
39           0
40           1
41           1
42           1
43           1
44           0
45           1
46           1
47           1
48           1
49           1
50           1
51           1
52           1
53           1
54           1
55           1
56           1
57           0
58           0
59           1
60           1
61           1
62           1
63           0
64           1
65           0
66           1
67           1
68           1
69           1
70           1
71           0
72           0
73           1
74           0
75           1
76           1
 [ reached 'max' / getOption("max.print") -- omitted 223 rows ]> heart_failure_clinical <-read.csv(file.choose(),header = TRUE)
> heart_failure_clinical
   age anaemia creatinine_phosphokinase diabetes ejection_fraction
1   75       0                      582        0                20
2   55       0                     7861        0                38
3   65       0                      146        0                20
4   50       1                      111        0                20
5   65       1                      160        1                20
6   90       1                       47        0                40
7   75       1                      246        0                15
8   60       1                      315        1                60
9   65       0                      157        0                65
10  80       1                      123        0                35
11  75       1                       81        0                38
12  62       0                      231        0                25
13  45       1                      981        0                30
14  50       1                      168        0                38
15  49       1                       80        0                30
16  82       1                      379        0                50
17  87       1                      149        0                38
18  45       0                      582        0                14
19  70       1                      125        0                25
20  48       1                      582        1                55
21  65       1                       52        0                25
22  65       1                      128        1                30
23  68       1                      220        0                35
24  53       0                       63        1                60
25  75       0                      582        1                30
26  80       0                      148        1                38
27  95       1                      112        0                40
28  70       0                      122        1                45
29  58       1                       60        0                38
30  82       0                       70        1                30
31  94       0                      582        1                38
32  85       0                       23        0                45
33  50       1                      249        1                35
34  50       1                      159        1                30
35  65       0                       94        1                50
36  69       0                      582        1                35
37  90       1                       60        1                50
38  82       1                      855        1                50
39  60       0                     2656        1                30
40  60       0                      235        1                38
41  70       0                      582        0                20
42  50       0                      124        1                30
43  70       0                      571        1                45
44  72       0                      127        1                50
45  60       1                      588        1                60
46  50       0                      582        1                38
47  51       0                     1380        0                25
48  60       0                      582        1                38
49  80       1                      553        0                20
50  57       1                      129        0                30
51  68       1                      577        0                25
52  53       1                       91        0                20
53  60       0                     3964        1                62
54  70       1                       69        1                50
55  60       1                      260        1                38
56  95       1                      371        0                30
57  70       1                       75        0                35
58  60       1                      607        0                40
59  49       0                      789        0                20
60  72       0                      364        1                20
61  45       0                     7702        1                25
62  50       0                      318        0                40
63  55       0                      109        0                35
64  45       0                      582        0                35
65  45       0                      582        0                80
66  60       0                       68        0                20
67  42       1                      250        1                15
68  72       1                      110        0                25
69  70       0                      161        0                25
70  65       0                      113        1                25
71  41       0                      148        0                40
72  58       0                      582        1                35
73  85       0                     5882        0                35
74  65       0                      224        1                50
75  69       0                      582        0                20
76  60       1                       47        0                20
   high_blood_pressure platelets serum_creatinine serum_sodium gender smoking time
1                    1    265000             1.90          130      1       0    4
2                    0    263358             1.10          136      1       0    6
3                    0    162000             1.30          129      1       1    7
4                    0    210000             1.90          137      1       0    7
5                    0    327000             2.70          116      0       0    8
6                    1    204000             2.10          132      1       1    8
7                    0    127000             1.20          137      1       0   10
8                    0    454000             1.10          131      1       1   10
9                    0    263358             1.50          138      0       0   10
10                   1    388000             9.40          133      1       1   10
11                   1    368000             4.00          131      1       1   10
12                   1    253000             0.90          140      1       1   10
13                   0    136000             1.10          137      1       0   11
14                   1    276000             1.10          137      1       0   11
15                   1    427000             1.00          138      0       0   12
16                   0     47000             1.30          136      1       0   13
17                   0    262000             0.90          140      1       0   14
18                   0    166000             0.80          127      1       0   14
19                   1    237000             1.00          140      0       0   15
20                   0     87000             1.90          121      0       0   15
21                   1    276000             1.30          137      0       0   16
22                   1    297000             1.60          136      0       0   20
23                   1    289000             0.90          140      1       1   20
24                   0    368000             0.80          135      1       0   22
25                   1    263358             1.83          134      0       0   23
26                   0    149000             1.90          144      1       1   23
27                   1    196000             1.00          138      0       0   24
28                   1    284000             1.30          136      1       1   26
29                   0    153000             5.80          134      1       0   26
30                   0    200000             1.20          132      1       1   26
31                   1    263358             1.83          134      1       0   27
32                   0    360000             3.00          132      1       0   28
33                   1    319000             1.00          128      0       0   28
34                   0    302000             1.20          138      0       0   29
35                   1    188000             1.00          140      1       0   29
36                   0    228000             3.50          134      1       0   30
37                   0    226000             1.00          134      1       0   30
38                   1    321000             1.00          145      0       0   30
39                   0    305000             2.30          137      1       0   30
40                   0    329000             3.00          142      0       0   30
41                   1    263358             1.83          134      1       1   31
42                   1    153000             1.20          136      0       1   32
43                   1    185000             1.20          139      1       1   33
44                   1    218000             1.00          134      1       0   33
45                   0    194000             1.10          142      0       0   33
46                   0    310000             1.90          135      1       1   35
47                   1    271000             0.90          130      1       0   38
48                   1    451000             0.60          138      1       1   40
49                   1    140000             4.40          133      1       0   41
50                   0    395000             1.00          140      0       0   42
51                   1    166000             1.00          138      1       0   43
52                   1    418000             1.40          139      0       0   43
53                   0    263358             6.80          146      0       0   43
54                   1    351000             1.00          134      0       0   44
55                   0    255000             2.20          132      0       1   45
56                   0    461000             2.00          132      1       0   50
57                   0    223000             2.70          138      1       1   54
58                   0    216000             0.60          138      1       1   54
59                   1    319000             1.10          136      1       1   55
60                   1    254000             1.30          136      1       1   59
61                   1    390000             1.00          139      1       0   60
62                   1    216000             2.30          131      0       0   60
63                   0    254000             1.10          139      1       1   60
64                   0    385000             1.00          145      1       0   61
65                   0    263358             1.18          137      0       0   63
66                   0    119000             2.90          127      1       1   64
67                   0    213000             1.30          136      0       0   65
68                   0    274000             1.00          140      1       1   65
69                   0    244000             1.20          142      0       0   66
70                   0    497000             1.83          135      1       0   67
71                   0    374000             0.80          140      1       1   68
72                   0    122000             0.90          139      1       1   71
73                   0    243000             1.00          132      1       1   72
74                   0    149000             1.30          137      1       1   72
75                   0    266000             1.20          134      1       1   73
76                   0    204000             0.70          139      1       1   73
   DEATH_EVENT
1            1
2            1
3            1
4            1
5            1
6            1
7            1
8            1
9            1
10           1
11           1
12           1
13           1
14           1
15           0
16           1
17           1
18           1
19           1
20           1
21           0
22           1
23           1
24           0
25           1
26           1
27           1
28           1
29           1
30           1
31           1
32           1
33           1
34           0
35           1
36           1
37           1
38           1
39           0
40           1
41           1
42           1
43           1
44           0
45           1
46           1
47           1
48           1
49           1
50           1
51           1
52           1
53           1
54           1
55           1
56           1
57           0
58           0
59           1
60           1
61           1
62           1
63           0
64           1
65           0
66           1
67           1
68           1
69           1
70           1
71           0
72           0
73           1
74           0
75           1
76           1
 [ reached 'max' / getOption("max.print") -- omitted 223 rows ]

Cannot install package “boot” in rstudio cloud.

library(boot)

set.seed(1)
bootstrap_correlation <- boot(heart_failure_clinical,function_1,R=299)
bootstrap_correlation

> library(boot)
> set.seed(1)
> bootstrap_correlation <- boot(heart_failure_clinical,function_1,R=299)
Error in boot(heart_failure_clinical, function_1, R = 299) : 
  object 'function_1' not found
> bootstrap_correlation
Error: object 'bootstrap_correlation' not found

Error package “vsurf” in rstudio cloud.

library(VSURF)
vsurf <- VSURF(formula = DEATH_EVENT ~., data = heart_failure_clinical, na.action = na.omit)
vsurf

> library(VSURF)
> vsurf <- VSURF(formula = DEATH_EVENT ~., data = heart_failure_clinical, na.action = na.omit)
Error in eval(m$data, parent.frame()) : 
  object 'heart_failure_clinical' not found
> vsurf
Error: object 'vsurf' not found

Please help me for rechecking them. Thank you.

The error messages you are showing have nothing to do with package installation problems but with you referencing objects that do not exist in your current working environment, can you check and clarify what your problem actually is?

Thank you very much for your comment. I can already amended error code in library (boot). Later, the codes can run the normal result.

Loading package "boot" (Functions for bootstrapping)

library(boot)

Creating Function to obtain R-Squared from the data

r_squared <- function(formula, data, indices) {
val <- data[indices,] # selecting sample with boot
fit <- lm(formula, data=val)
return(summary(fit)$r.square)
}

Performing 299 replications with boot

output <- boot(data=heart_failure_clinical, statistic=r_squared,
R=299, formula=DEATH_EVENT~serum_creatinine+anaemia)

Plotting the output

output
plot(output)

Obtaining a confidence interval of 95%

boot.ci(output, type="bca")

`> library(boot)

r_squared <- function(formula, data, indices) {

  • val <- data[indices,] # selecting sample with boot
  • fit <- lm(formula, data=val)
  • return(summary(fit)$r.square)
  • }

Performing 299 replications with boot

output <- boot(data=heart_failure_clinical, statistic=r_squared,

  •            R=299, formula=DEATH_EVENT~serum_creatinine+anaemia)
    

Plotting the output

output

ORDINARY NONPARAMETRIC BOOTSTRAP

Call:
boot(data = heart_failure_clinical, statistic = r_squared, R = 299,
formula = DEATH_EVENT ~ serum_creatinine + anaemia)

Bootstrap Statistics :
original bias std. error
t1* 0.08919886 0.007204561 0.02901739

plot(output)

Obtaining a confidence interval of 95%

boot.ci(output, type="bca")
BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
Based on 299 bootstrap replicates

CALL :
boot.ci(boot.out = output, type = "bca")

Intervals :
Level BCa
95% ( 0.0363, 0.1392 )
Calculations and Intervals on Original Scale
Some BCa intervals may be unstable`