Plate creator raw data9/8/2023 ![]() ![]() That being said this nevertheless is a bad idea because for the conditional construct and allocate functions you will probably have more overhead opposed to copying your elements once. Additionally you will have to initially resize your vector to 33 elements to force the vector to have the correct size. You can achieve some of the functionality this by creating your own allocator according to this concept, but to have your 33 elements to not be reconstructed you will also have to provide a allocator::construct(.) function which is a no-op until the 34th element (exclusive). Notice that the allocator argument is necessary as the T* must (theoretically) have been returned by the exact same allocator that is used in the vector. So the signature of the constructor you need would be something like std::vector::vector(T* data, size_type used_elements, size_type capacity, const Allocator& alloc). If your implementation of the standard library for example uses malloc and free instead of new and delete, your program will fail.įor this to become a standard way, the standard library would need to provide a constructor that accepts a T* which additionally must have been returned by the same allocator the vector uses later. ![]() Therefore if you have an std::vector which uses a certain type of allocator and give it some pointer you have created, you effectively break the allocator idiom. Mutate(pcr.plate = paste0(pcr.The reason why this is not directly possible is that the standard library uses allocators to reserve memory for the containers. ![]() Let me know if you have questions! gather(pcr_plate, key = "key", value = "sample", ate) %>% This is another way to do it though to get the same result. Mutate(pcr.plate = paste0(pcr.plate, gsub("X", "", key))) %>%Īrrange(gsub("\\d", "", well_ID, as.numeric(gsub("\\D", "", well_ID))))įalse alarm on my comment, it did work as intended. Let me know if this doesn't work or if you have any questions.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |