R-studio Trial

0 views
Skip to first unread message

Aleshia Ducharme

unread,
Aug 4, 2024, 8:24:30 PM8/4/24
to pampquarweane
HelloI am trying to make a graph in R that plots the bag time (s) against the number of trials. I can't figure out how to connect individual points across the trails. By that, I mean that one individual ran anywhere from 1 trial up to 11. For the individuals that ran more than 1 trial, I need a line to follow their performance through all of their trials. Is this possible in R?

My code to create the points can be found below. This plots the points of all trials across all individuals, however, I am stumped on how to get lines to connect the points of each individual across their trials. Thank you!


Hi ron, I believe that worked! The data file was imported from excel and is a huge data set, I wasn't entirely sure how to share it. This is what I got from that code and it looks like it did what I needed it to. I'm wondering if there is any way to make it look a little cleaner.


Hi, so that did work and it looked pretty great. How would I add an overall trend line to this graph? I'm looking for something that would show the overall "population trend" based on the average behavior of the individuals.


I'm really struggling trying to figure out how to share the data after the subset... I have this "p3" window in R that has the spreadsheet after the subset but I have no idea how to share it. At this point I'm reading a bunch of different of these pages and I have no idea what any of it means and I'm getting so frustrated I could literally cry. This shouldn't be this difficult, I'm an R newbie


After almost throwing my computer across the room, I went up to my boss and we figured that out. Thank you so much for your help on this. It's amazing how one tiny little issue like it being numeric vs factor can cause such pain haha.


About the trial licence, I think you need to activate it manually if it does not work as is. I could fail if you do not have internet access or it could fail in VM, hence in docker. Did you try to get the trial licence manually using the app linked in the message ?

You should get a code to use to activate the licence manually in the product.


Just to be completely transparent here - the trial license has a hard time activating in docker due to the way that docker virtualization clashes with the license manager's attempt to uniquely identify a server.


If you would like to try running RStudio Connect in a docker container, and the advice above doesn't get you functional, I would recommend contacting our Customer Success team at sa...@rstudio.com . They can get you a trial license that will work better inside of docker (either floating or not). We have some patterns that you can follow here:


TL;DR; Connect works fine inside of docker. However, the trial does sometimes have some trouble activating inside of docker. You are still completely eligible for the 45 day free trial, though! It just needs some input from our team to get it working, unfortunately Hope that helps!


Hello,

I am a novice in R and I would like some help. I have an .xlsx data file for each subject with 288 trials each. Before I merge all these excel files together I want to add the subject number which is part of each file name (e.g, subject-103) as a new column next to each trial. So for each of the 288 trials the subject number should be listed.


You can do this using tidyr::separate(), which allows you to split a character column into multiple columns, and you'd keep the original column (if you wish to do so) be setting the remove argument to FALSE (remove = FALSE).


Dear @mara thank you for your response.

Ok, here is the case: i have around 123 subjects and each subject has 288 trials. The trials for each subject are saved in a separate excel file.

So, i have the following questions:


You can do this all with a script. There are many ways to do this in R, but the how-to using the purrr package is described very well in this post, the only difference for you is that you are reading in an .xlsx file (I assume) instead of .csv.


You can read and combine them together using purrr::map_dfr() (again, the post has all the details), and save the source (i.e. the filename) by using the .id argument. At that point you'll have all the data in one data frame, and you can extract the subject id from the column you created from .id.


hello again @mara @Wendell_Miyaji and everyone else,

I have tried several things based on your suggestions but I cannot figure out how to get the result I need. So I will try once more to explain better what I want to do.


I was thinking that I should maybe create a loop which will read from each file's individual name, create the new column in each file with the subject id be present in each of the 197 rows and then save an updated file on my desktop.


If you look at the post on reading in a folder, you'll see that "mapping" is similar to a loop, in that you apply the operation (functions) to whatever you're "mapping" over (in your case, a bunch of files). Just as you can do this to read in files, you can write them out, if you want to keep them separate. Are they stored directly on your desktop? If so, you can choose them based on file extension or name pattern, but it might be easier to put them together in a folder.


For a number of reasons (e.g. what you're trying to do now to all of the files), it's useful to group things together in a single data frame, and then use your grouping variable for calculations, or filter them out as needed. That said, you could keep them in separate files (though the fact that you want the subject number in a column suggests to me that you're probably going to be working with them "together" in some sort of way).


What have you tried, and where are you getting stuck? The best practice here is to figure it out for one file (I think you have the pieces for that now), and then do it for all of them together. Have you successfully gotten that first part down?


Is there a way to direct the system to the main folder with all the individual excel files and ask to do the same thing as above, that is create a new column adding in each of the 288 rows the subject id based on the file name and then merge the files together once it is done with the previous process?


From your previous post, I understand that your ultimate goal is to merge all files into a single data frame but keeping track of the origin, if that is still the case, the approach suggested by Mara is the way to go, I'm going to give you some general pattern code so you can have a starting point.


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.



If you have a query related to it or one of the replies, start a new topic and refer back with a link.


RStudio on Amazon SageMaker is the first fully managed cloud-based Posit Workbench (formerly known as RStudio Workbench). RStudio on Amazon SageMaker removes the need for you to manage the underlying Posit Workbench infrastructure, so your teams can concentrate on producing value for your business. You can quickly launch the familiar RStudio integrated development environment (IDE) and scale up and down the underlying compute resources without interrupting your work, making it easy to build machine learning (ML) and analytics solutions in R at scale.


Setting up a new Amazon SageMaker Studio domain with RStudio support or adding RStudio to an existing domain is now easier, thanks to the service integration with AWS Marketplace and AWS License Manager. You can now acquire your new Posit Workbench license or request a trial directly from AWS Marketplace and set up your environment using the AWS Management Console. In this post, we walk you through this process in three straightforward steps:


You will receive an email with a link to a $0 limited-time private offer that you can open while logged in to your AWS account. After you accept the offer, you will be able to follow the next steps to activate your license grant.


You can see two entitlements related to Posit Workbench: one for AWS Marketplace usage and the other for named users. In order to be able to use your license and create a Studio domain with RStudio support, you need to accept the license.


You can configure RStudio on Amazon SageMaker as part of a multi-step SageMaker domain creation process on the console. You can also perform the steps using the AWS Command Line Interface (AWS CLI) following the instructions on Create an Amazon SageMaker Domain with RStudio using the AWS CLI. To create your domain on the console, complete the following steps:


You can choose the instance type for the RStudio server that is going to be shared by all users in your domain. ml.t3.medium is recommended for Domains with low UI use and is free to use. For more information about how to choose an instance type, see RStudioServerPro instance type page. Note that this is not the instance where your R sessions run their analysis and ML code.


Creating a user in your Studio domain allows access to both Studio and RStudio on SageMaker. You can configure both on the SageMaker console. If you prefer to use the AWS CLI to set up a user, refer to Manage users. To enable RStudio for a user via the console, complete the following steps:


When you launch your RStudio session, the Base R image serves as the basis of your instance. This Docker image includes R v4.0, AWS tools such as awscli, sagemaker, and boto3 Python packages, and the reticulate package for the interoperability between Python and R.


In this post, we showed how you can easily set up your RStudio on Amazon SageMaker environment in three straightforward steps. You can now either acquire a new paid Posit Workbench license or request a trial directly from AWS Marketplace and quickly import your license using License Manager. We also showed you how, after you accept the license grant, Studio automatically detects your new license and allows you to create a Studio domain with Posit Workbench support. We encourage you to try out RStudio on Amazon SageMaker today by following these steps and give us your feedback in the comments section!

3a8082e126
Reply all
Reply to author
Forward
0 new messages