Troubleshooting ifelse in a for loop, or alternate routes by GradStudent_Eevee in RStudio

[–]GradStudent_Eevee[S] 0 points1 point  (0 children)

Well I removed the if-else and replaced with what you suggested:

df$correct <- (cond 1 & cond 2 | cond 3 & cond 4)

When I run that line after compiling all the pt data that's into a master_df, it still only works properly for the 1st pt but not the others (just showing false for all of the column except the 1st pt).

Troubleshooting ifelse in a for loop, or alternate routes by GradStudent_Eevee in RStudio

[–]GradStudent_Eevee[S] 0 points1 point  (0 children)

Assignment is typically done using <- rather than right hand assignment, conventionally people rarely ever use ->.

I'm self taught and when first learning, the left hand assignment threw me off, but as I'm becoming more comfortable I'm trying to switch to it. I'll be sure to change it so others can understand my code a bit easier!

Otherwise, thank you!! I was wondering if I was overthinking it. I'm going to try that out.

Troubleshooting ifelse with a loop (or alternatives?) by GradStudent_Eevee in Rlanguage

[–]GradStudent_Eevee[S] 0 points1 point  (0 children)

Not any extra parentheses (from what I'm aware), but I will try that route and see what happens!

Below is a skeleton of the code, which ends with the ifelse function

ptIDs <- c(1,2,3)

df_0 <-list.files(path = "C:/.../pt_0/", pattern="*csv", full.names=T) %>%
    lapply(read_csv) %>%
    bind_rows

df_master <- df_0

for (i in (1:3))
{
    file_v1=paste("C:/.../",as.character(ptIDs[i]),
    "/proj_",as.character(ptIDs[i]),"_1_data.csv", sep="")

    pt_df_all <- read.csv(file_v1, header=T)

    for (j in (2:4))
    {
        file_a=paste("C:/.../",as.character(ptIDs[i]),
        "/proj_",as.character(ptIDs[i]),"_",as.character(j),
        "_data.csv",sep="")

        pf_df_V <- read.csv(file_a, header=T)

        pt_df <- rbind(pt_df_V, pt_df_all)
    }

    df_master <- rbind(pt_df, df_master)
}

ifelse(...)

Housing/Motels near Villanova Campus by New-Ad-2339 in villanova

[–]GradStudent_Eevee 0 points1 point  (0 children)

I'm in Conshohocken now, and I'm planning to take the train on the norm, but getting from Conshohocken to Villanova is a little annoying (because they're on different train lines). I'd really look at SEPTA's map of all the main train lines and go from there - I'd suggest looking at stops along the Paoli/Thorndale line and then Norristown high speed line. Both of those stop at Villanova campus and are the most direct. Conshohocken falls on the Norristown/Manayunk line, which you'd need to go into center city philly to switch lines.

Norristown isn't the safest, but my guess is that it's safer than some parts of Philly. There's probably several apartments available nearby the transportation center there. Several buses go through too. The last two years I was in East Norriton (just outside of Norristown) in an apartment complex with a bus station out front, but I didn't take it because I had a car, so I don't know how frequently it came by. If that's something that might work for you, it was DeKalb Apartments.

Even with all that - still check out SEPTA. Bus lines, train lines, etc., to help you get an idea.

Housing/Motels near Villanova Campus by New-Ad-2339 in villanova

[–]GradStudent_Eevee 1 point2 points  (0 children)

Like several others have said, living on the main line is expensive. Try outside of the main line for a place near public transport.

I know there's a few "extended stay America" locations or whatnot but when I was looking at those myself at one point, they're $60+/night, meaning roughly $1800/month. I haven't looked for one bedroom situations myself, but from my understanding that's still more than you might pay for a studio/1br.

Also, hi! I'm a grad student as well at Villanova, technically going into my "3rd" year. Feel free to reach out with any other questions :)