Experimental browser for the Atmosphere
Can someone tell me how to add a column based on cell values in a different column. I have df1, and I want to make it look like df2... My best guess is mutate, but I couldn't figure it out when the values are words and not numbers. I also want to make df3 based on df2. #Rstats
Sep 23, 2024, 9:58 PM
{ "uri": "at://did:plc:k5tkwyi4w2isctghvfxaom3p/app.bsky.feed.post/3l4u3yejxii2p", "cid": "bafyreigd7rpvabzinohsjj6zrpzoubl53qhrlvv4t5fbcee5qzxv5thi4e", "value": { "text": "Can someone tell me how to add a column based on cell values in a different column. I have df1, and I want to make it look like df2... My best guess is mutate, but I couldn't figure it out when the values are words and not numbers.\n\nI also want to make df3 based on df2. \n#Rstats", "$type": "app.bsky.feed.post", "embed": { "$type": "app.bsky.embed.images", "images": [ { "alt": "Three data frames. The First data frame is only a list of cities. The second data frame has a list of cities as one column, and a list of the corresponding counties in the second column. The third data frame is the aggregated data where the first column is city, the second column is county, and the third column is n, where n is the number of times the City is in df2.", "image": { "$type": "blob", "ref": { "$link": "bafkreiaktdmphckjb2o2fi7iukvnlifpi5c7xbfuwcadqhazzimf5t4ncy" }, "mimeType": "image/jpeg", "size": 128253 }, "aspectRatio": { "width": 842, "height": 421 } } ] }, "langs": [ "en" ], "facets": [ { "index": { "byteEnd": 279, "byteStart": 272 }, "features": [ { "tag": "Rstats", "$type": "app.bsky.richtext.facet#tag" } ] } ], "createdAt": "2024-09-23T21:58:20.243Z" } }