Question: I ran the apply function on a data frame in order to extract the positions of all cells with a value >-1. However, in my results I have a different number of cells in each column and R will not allow me to convert the results into a data frame because of this. 

Sample of my original data frame (Actual has 500+ columns):

```
Slopes<-data.frame(B1=5:495,B2=-100:390, B3=10:500,B4=-200:290)
row.names(Slopes)<-seq(0.01, 4.91, 0.01)

```

This is the function I ran over the vectors:

```
Z<-apply(Slopes, 2, function(x) which(x>-1))

```

How can I fill in the missing cells with "NA" so that I can convert these results into a data frame?

Also I just had to add this edit because now that I have successfully made the data frame, I have found that R returned the row numbers rather than the row names. Any alterations I can make to my apply code which would return the row names instead?

Answer: 
Just had the problem happen to me again. I got the problem solved, but unfortunately I can't confirm the solution, now that it's fix; but I have strong suspicions on what was the cause.

In my case, the problem occurred as a result of reorganizing my project directory. My projects are stored in given directory lets call it "Projects". I renamed that fold to "ProjectsBackup" and created a new "Projects" directory. I then moved selected projects now contained in the "ProjectBackup" directory to the new "Projects" directory. After moving the first project, I used Android Studio to open that project. That's when the problem occurred. I got a message that it couldn't find the gradle-wrapper and offered me the choice to create it. The gradle-wrapper is stored in a directory call "gradle" and its stored in the "Projects" directory. I had not copied that directory over from the "ProjectsBackup" to the new "Projects" directory. At the time, I thought nothing about that since, a new one was created. After trying all the various suggestion in this problem discussion, android studio offered a notification from me to update my "android gradle" plugin. I did the update and after that the "android" view was now available for me to select. The android gradle update fixed the problem.

I unfortunately, can't tell you what changed as a result of the update, nor can I tell you how you can force Android Studio to update or reinstall the android gradle plugin. All I can tell you is that I got lucky that android studio gave me that notification to update the android gradle plugin. Things like "file/project structure" and changing the Android Gradle Plugin Version, didn't fix the problem. What I did notice, was that when I first looked at that, the drop-down list of android gradle versions was an empty list. I manually put one in "3.6.3", but it didn't help. If you run into this problems I would suggest you look at the dates of the two file in the "wrapper" directory and compare those to projects you may have that are working correctly with the android view. I wish I would have checked the date of the wrapper jar file, when it wasn't working. That's what I think might have been wrong (i.e. I got a wrapper.jar file that was incompatible with my version of android studio - unfortunately I can't prove that)
[![enter image description here](https://i.stack.imgur.com/iET2l.png)](https://i.stack.imgur.com/iET2l.png)

problem solve i have click this button